mirchaye / laravel-shopping-cart
Simple laravel shopping cart package
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2025-03-09 04:57:14 UTC
README
This Shopping Cart Package is a versatile and user-friendly shopping cart solution for Laravel applications. It empowers developers to effortlessly integrate a shopping cart system into their e-commerce projects.
➕ Features:
- Easy Cart Management: Add, update, and remove items from the cart with simple and intuitive methods.
- Multiple Instances: Create multiple instances of the cart, each with its own set of items, catering to different requirements.
- Flexible VAT Handling: Support for items with or without VAT, giving you control over tax calculations.
- Custom Tax Rate: Set the tax rate for the cart to ensure accurate tax calculation based on your region or business rules.
- Convenient Totals: Get total, subtotal, and tax amounts with ease, making it a breeze to display accurate cart summaries.
- Comprehensive Testing: The package comes with a robust suite of unit tests, ensuring reliable and bug-free functionality.
Installation
You can install the package via composer:
composer require mirchaye/laravel-shopping-cart
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-shopping-cart-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-shopping-cart-config"
This is the contents of the published config file:
return [ 'tax_rate' => 15.0, ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-shopping-cart-views"
Usage
$shoppingCart = new Mirchaye\ShoppingCart(); echo $shoppingCart->echoPhrase('Hello, Mirchaye!');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.