If the code is correct check settings in vs code. There should something covering that in the documentation.
For example https://marketplace.visualstudio.com/items?itemName=georgykurian.laravel-ide-helper
Check that.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Friends, I want to ask that I am using the cart package in laravel.
in Controller:
use Gloudemans\Shoppingcart\Cart;
Cart::add([
['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 10.00, 'weight' => 550],
['id' => '4832k', 'name' => 'Product 2', 'qty' => 1, 'price' => 10.00, 'weight' => 550, 'options' => ['size' => 'large']]
]);
it shows this msg with curly lines below the code:
The non-static method 'add' should not be called statically.intelephense(1036
in vs code
What Is the Reason Plz Help Me?
change:
use Gloudemans\Shoppingcart\Cart;
to this:
use Gloudemans\Shoppingcart\Facades\Cart;
use the facade.
Please or to participate in this conversation.