I am getting the above error, which references two things: helpers.php, which is a bunch of helper functions, and CartController.php. I have searched both files and associated functions with no luck.
From helpers.php:
function getNumbers()
{
$tax = config('cart.tax') / 100;
$discount = session()->get('coupon')['discount'] ?? 0;
$code = session()->get('coupon')['name'] ?? null;
$newSubtotal = (Cart::subtotal() - $discount); //The error points to this line
if ($newSubtotal < 0) {
$newSubtotal = 0;
}
$newTax = $newSubtotal * $tax;
$newTotal = $newSubtotal * (1 + $tax);
return collect([
'tax' => $tax,
'discount' => $discount,
'code' => $code,
'newSubtotal' => $newSubtotal,
'newTax' => $newTax,
'newTotal' => $newTotal,
]);
}
From CartController.php:
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$relatedProducts = Product::relatedProducts()->get();
return view('cart/cart')->with([
'relatedProducts' => $relatedProducts,
'discount' => getNumbers()->get('discount'), //The error points to this line
'newSubtotal' => getNumbers()->get('newSubtotal'),
'newTax' => getNumbers()->get('newTax'),
'newTotal' => getNumbers()->get('newTotal'),
]);
}
I am using Gloudemans. I have done a composer update, searched online, but have found no success or much information.
Any suggestions? Thank you!