问题
I am using Crinsane/LaravelShoppingcart
with Laravel 5. When I try to add items to Cart then it will display error
Non-static method Gloudemans\Shoppingcart\Cart::add() should not be called statically, assuming $this from incompatible context
Any help for resolve this..
回答1:
Add this line at the top of your PHP file:
use Cart;
instead of this:
use Gloudemans\Shoppingcart\Cart;
来源:https://stackoverflow.com/questions/28526033/shopping-cart-error-laravelshoppingcart