Installation and setup

1) Install the package by running this command in your terminal/cmd:

composer require freshbitsweb/laravel-cart-manager

2) Import config file by running this command in your terminal/cmd:

php artisan vendor:publish --tag=laravel-cart-manager-config

And set the options according to your requirements.

Note: Options 3 is required for DatabaseDriver only

3) Import migrations files by running this command in your terminal/cmd:

php artisan vendor:publish --tag=laravel-cart-manager-migrations

And migrate your database to create necessary tables.

4) Add a trait to the model(s) of cart items:

...
use Freshbitsweb\LaravelCartManager\Traits\Cartable;
...
class Product extends Model
{
    use Cartable;
    ...
}

Configuration Options