Documentation

Learn how to use FlexiCart in your Laravel application.

Installation

Requirements

  • PHP 8.3 or higher
  • Laravel 11.0 or higher
  • Brick/Money package (automatically installed)

Install the Package

composer require daikazu/flexicart

Publish Configuration

php artisan vendor:publish --tag="flexicart-config"

Database Storage (Optional)

If you prefer database storage over session storage:

php artisan vendor:publish --tag="flexicart-migrations"
php artisan migrate

Then update your .env file:

CART_STORAGE=database

Next Steps

Once installed, you can start using the Cart facade to add items:

use Daikazu\Flexicart\Facades\Cart;

Cart::addItem([
    'id' => 1,
    'name' => 'Product Name',
    'price' => 29.99,
    'quantity' => 1
]);

See the Basic Usage section for more details.

Shopping Cart

0 items

Your cart is empty

Add some products to get started!