\ Symfony \ Component \ Debug \ Exception \ FatalThrowableError
Аргумент 1, передаваемый в Darryldecode \ Cart \ Cart :: Darryldecode \ Cart {closure} (), должен быть экземпляром Darryldecode \ Cart \ CartCondition, instance Darryldecode \ Cart \ ItemCollection предоставлен
C: \ wamp64 \ www\blog \ vendor \ darryldecode \ cart \ src \ Darryldecode \ Cart \ Cart. php: 589
I только что сделал composer dumpautoload, и я получаю эту ошибку после этого, когда я go до http://localhost/ecom/public/cart. Я пользуюсь Darryldecode Cart Library. Перед выгрузкой корзина работала нормально.
Функция создания корзины работает нормально, но не индекс
public function index()
{
$cartSubTotal = Cart::getSubTotal();
$condition = new \Darryldecode\Cart\CartCondition(array(
'name' => 'GST',
'type' => 'tax',
'target' => 'total',
'value' => '5%',
'attributes' => array( // attributes field is optional
'description' => 'Goods & Services Tax',
'more_data' => 'It is 5% of the total Value'
)
));
$cartTotal = Cart::getTotal();
$gst = $cartSubTotal * 0.05;
$datas = Cart::getContent();
//$product = Products::whereIn('id', $datas->pluck('id')->all())->get();
return view('cart.index', compact('datas','cartSubTotal','gst','cartTotal','condition'));
}