skip to Main Content

How to store cart items in session without logged in user and with logged in user in Laravel

I'm using this package "darryldecode/cart" for shopping cart functionality in laravel, for adding items to cart using this method Cart::session($userID)->add([ 'id' => $productId, 'name' => $productDetails['name'], 'price' => $productDetails['price'], 'quantity' => $productDetails['quantity'], 'attributes' => [], 'associatedModel' => $productDetails, ]); but…

VIEW QUESTION

Binding Factory and model with custom namespace in Laravel 11.x

I have a User model in modules/Users/Models directory and UserFactory in the default database/factories directory. I made this provider to avoid Class "DatabaseFactoriesModulesUsersModelsUserFactory" not found error when php artisan db:seed namespace AppProviders; use IlluminateSupportServiceProvider; use IlluminateDatabaseEloquentFactoriesFactory; use IlluminateSupportStr; class FactoryServiceProvider…

VIEW QUESTION
Back To Top
Search