I'm sorry I'm pretty new to Laravel but can't get this to work.
The error I'm getting is:
FatalErrorException in CartController.php line 15: Class 'App\Http\Controllers\Cart' not found
My CartController.php:
'''
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class CartController extends Controller
{
public function addToCart()
{
Cart::add('192ao12', 'Product 1', 1, 9.99);
Cart::add('1239ad0', 'Product 2', 2, 5.95, array('size' => 'large'));
return 'Added';
}
public function viewCart()
{
return view('pages.cart');
}
}
'''
I think I need to add a 'use' but how exactly?
Thanks in advance
You indeed have to use the Cart namespace. Simply "use Cart;"
thanks
thanks
Thanks, that was helpful...
Most helpful comment
You indeed have to use the Cart namespace. Simply "use Cart;"