Crinsane / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
3.66k stars 1.72k forks source link

The store method is not storing anything in the db #680

Open Malfunction13 opened 1 year ago

Malfunction13 commented 1 year ago

Hi community, Can you please explain how to properly setup the cart because it simply does not write anything to the db when using the store() method. Utilizing the package via Facade Using Laravel8 in Docker container setup and MySQL again in a container. It doesn't throw any errors, dumping provides contents/total etc/ however nothing is persisted to DB.

Is there some specific configuration that needs to be done in cart.php for DB connection or am I missing something else?

darshannv commented 1 month ago

Try to use Laravel facade for example :-

$rowId = $request->input('rowId');
     $qty` = $request->input('qty');

        // Update the cart
        Cart::update($rowId, $qty);