hardevine / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
348 stars 120 forks source link

Class "Product" not found #46

Closed assadali007 closed 1 year ago

assadali007 commented 2 years ago

Hello everyone, i am using the hardevine/shoppingcart this is my controller code this said that

public function store(Request $request) {

    Cart::add($request->id,$request->name,1,$request->price)
        ->associate('App\Models\Product');

    return redirect()->route('cart.index')->with('success_message','Item was added to your cart');
}

this error have come

Class "Product" not found

assadali007 commented 2 years ago

https://flareapp.io/share/J7oajOGm#F54

hardevine commented 2 years ago
->associate('App\\Models\\Product');
assadali007 commented 2 years ago

brother still error have come

assadali007 commented 2 years ago

brother still coming please me to solve out this error https://flareapp.io/share/Rmrn9xKm#F54

assadali007 commented 2 years ago

it bit confused sometime code working fine and sometime said Class "App\Product" not found why ??

MShahzaib3242 commented 2 years ago

I'm continuously getting this error while adding products in bulk Call to a member function associate() on array