itmosoft / laravel-checkout
A reusable Laravel checkout orchestration package with address snapshots, cart validation, shipping selection, and checkout state management. Supports Laravel 12 and 13.
v1.0.1
2026-11-04 14:53 UTC
Requires
- php: ^8.3
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Checkout orchestration for Laravel 12 and 13 / PHP 8.3+.
Features
- Persistent checkout sessions linked to an existing cart
- Cart line snapshots
- Billing and shipping address snapshots
- Shipping method and amount selection
- Discount, tax, shipping, and grand-total composition
- Required-field validation before completion
- Transactional completion with row-level locking
- Configurable table prefix and session model
Install
composer require itmosoft/laravel-checkout php artisan vendor:publish --tag=itmosoft-checkout-config php artisan migrate
Requires itmosoft/laravel-cart.
Start checkout
$checkout = app(\\ItmoSoft\\Checkout\\Services\\CheckoutManager::class) ->start($cart, auth()->id());
Set addresses and totals
$manager->setAddresses($checkout, $billingAddress, $shippingAddress); $manager->selectShipping($checkout, 'standard', 5.00); $manager->setTotals($checkout, discount: 10, tax: 13.50); $errors = $manager->validate($checkout); if ($errors === []) $manager->complete($checkout);
Checkout snapshots are not a substitute for final server-side price, promotion, tax, stock, and shipping validation. This package does not create orders, reserve inventory, or process payments. Never trust client-submitted totals.
Testing
composer install vendor/bin/phpunit
License
MIT.