aiarmada / filament-cart
A comprehensive Filament admin interface for managing shopping carts created by the AIArmada Cart package
Requires
- php: ^8.4
- aiarmada/cart: v0.1.34
- aiarmada/commerce-support: v0.1.34
- filament/filament: ^5.6.5
Requires (Dev)
None
Suggests
- aiarmada/filament-signals: Optional analytics and alert management UI for cart Signals events
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-15 10:22:55 UTC
README
Filament admin panel integration for aiarmada/cart. Provides normalized cart data resources, condition management, and real-time synchronization for high-volume commerce operations.
Requirements
- PHP 8.4+
- Laravel 13+
- Filament 5+
- aiarmada/cart
Installation
composer require aiarmada/filament-cart
Register the plugin in your Filament panel provider:
use AIArmada\FilamentCart\FilamentCartPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentCartPlugin::make(), ]); }
Publish the configuration (optional):
php artisan vendor:publish --tag="filament-cart-config"
Resources
The plugin registers four Filament resources under the E-Commerce navigation group:
| Resource | Model | Purpose |
|---|---|---|
| Carts | AIArmada\\Cart\\Snapshots\\CartSnapshot |
View normalized cart snapshots |
| Cart Items | AIArmada\\Cart\\Snapshots\\CartSnapshotItem |
Browse individual line items |
| Cart Conditions | AIArmada\\Cart\\Snapshots\\CartSnapshotCondition |
View conditions applied to carts |
| Conditions | AIArmada\\Cart\\Models\\Condition |
Manage reusable condition templates |
Cart Resource
Read-only resource displaying cart snapshots with:
- Instance filtering (default, wishlist, quote, layaway)
- Item and condition counts
- Subtotal and total calculations
- Metadata search
Cart Item Resource
Read-only resource for line item analysis:
- Price and quantity filters
- Attribute inspection
- Parent cart navigation
- JSON-searchable metadata
Cart Condition Resource
Read-only resource showing applied conditions:
- Type badges (discount, fee, tax, shipping)
- Target visualization (subtotal, total, item)
- Value display (percentage or fixed)
- Calculation order
Condition Resource
Full CRUD for reusable condition templates:
- Create discount, tax, fee, and shipping conditions
- Configure dynamic rules with factory keys
- Set global auto-apply behavior
- Manage condition ordering
Widget
The CartStatsWidget displays key metrics on your dashboard:
- Active cart count
- Total cart items
- Total cart value
Configuration
// config/filament-cart.php return [ 'navigation' => [ 'group' => 'E-Commerce' ], 'polling_interval' => 30, ];
// config/cart.php return [ 'dynamic_rules_factory' => \AIArmada\Cart\Services\BuiltInRulesFactory::class, 'conditions' => [ 'apply_global' => true, ], 'snapshots' => [ 'synchronization' => [ 'queue_sync' => true, 'queue_connection' => null, // Uses queue.default when omitted 'queue_name' => 'cart-sync', ], ], ];
The adapter block belongs in config/filament-cart.php; the condition and
snapshot settings belong in the core config/cart.php file.
Event Synchronization
The core aiarmada/cart package owns snapshot projection and registers its
event listeners. Filament Cart consumes the resulting read model and provides
the UI adapter:
AIArmada\\Cart\\Snapshots\\SyncCartOnEvent— Creates/updates normalized recordsAIArmada\\Cart\\Listeners\\ApplyGlobalConditions— Applies global conditionsAIArmada\\Cart\\Snapshots\\CleanupSnapshotOnCartMerged— Handles merge cleanup
Dynamic Conditions
Create conditions with rule-based application:
use AIArmada\Cart\Models\Condition; Condition::create([ 'name' => 'bulk_discount', 'display_name' => '10% Bulk Discount', 'type' => 'discount', 'target' => 'cart@cart_subtotal/aggregate', 'value' => '-10%', 'rules' => [ 'factory_keys' => ['min-items', 'total-at-least'], 'context' => ['min' => 3, 'amount' => 10000], ], 'is_active' => true, 'is_global' => true, ]);
Actions
Filament actions for cart operations:
ApplyConditionAction— Apply a condition template to a cartRemoveConditionAction— Remove a condition from a cart
Testing
./vendor/bin/pest tests/src/FilamentCart --parallel
License
MIT License. See LICENSE for details.