Shopping Cart Error (LaravelShoppingcart)

心已入冬 提交于 2020-01-30 12:13:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!