Link to the demo project that works?
Vanilo "Class "Cart" not found"
I am using Vanilo 3.x trying to create an ecommerce website.
Today when I tried accessing the Cart facade for the first time in the layout view of my web app like so - @if (Cart::doesNotExist()) // code @endif as detailed in the Vanilo tutorial Laravel threw a 'Class "Cart" not found' error. This makes me believe it's not recognizing Cart as a facade.
I checked out the demo site that shows an example of how to use the framework, and on it the layout view calls the Cart facade just as I do @if (Cart::isNotEmpty()) and it all works fine there.
The config/app.php file does not contain any aliases or providers entries for the Cart facade, but it's still usable. When I try to add the CartManager into providers and then into aliases, an error is thrown stating "vanilo.cart.session_key is empty, please provide key". In my understanding, according to the Vanilo Docs, a cart is only created if it is necessary, so it doesn't flood the database with empty carts for every single visit. But the facade should still be accessible even if a cart isn't created, so by registering the cart facade into config/app.php I think I'm forcing it to try and get the cart, even though it's not created. Or maybe I'm just rambling on about stuff I don't quite understand.
I need some help trying to figure out what is going wrong, I have compared the framework configuration files (config/vanilo.php and config/concord.php) from the demo with my app and there doesn't seem to be anything out of order. I can provide code from the app, I just don't know what code would be relevant to the issue at hand initially.
@denabyte Not sure where its registered. But add it yourself here: https://github.com/vanilophp/demo/blob/2.x/config/app.php#L228
'Cart' => \Vanilo\Cart\Facades\Cart::class,
Please or to participate in this conversation.