1
votes

I have an error in my code in Laravel.

Its shows this

Argument 1 passed to Order\Order::__construct() must be an instance of System\RewardPoint, none given, called in C:\xampp\htdocs\stardibs-version2\stardibs-v2\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 647 and defined

order.php

use BaseModel, DB; 
use Eloquent, User\User, Auth, Cart, Order\Order; 
use System\RewardPoint as RewardPoint; 

class Order extends BaseModel {

    public function __construct(RewardPoint $rewardPoint)
    {
        $this->rewardPoint = $rewardPoint;

    }
}

What is the solution for this?

1
Please, be specific about the version tag in your question.gmsantos
You can edit your question. Its a good ideia to read the tour too.gmsantos

1 Answers

1
votes

When creating the objecct of class Order you need to pass an object RewardPoint to its constructor:

$rewardPoint = new RewardPoint(/** whatever arguments are needed **/);
$order = new Order($rewardPoint);