aiarmada/filament-promotions
最新稳定版本:v1.0.0
Composer 安装命令:
composer require aiarmada/filament-promotions
包简介
A Filament v5 plugin for administering promotions provided by the AIArmada promotions package
README 文档
README
A Filament v5 plugin for managing promotional discounts in your admin panel.
Features
- Full CRUD — Create, view, edit, and delete promotions
- Rich Table — Sortable, filterable promotion list with badges
- Promotion Types — Percentage, fixed amount, and Buy X Get Y
- Usage Tracking — Monitor promotion usage statistics
- Owner Scoping — Multi-tenant support out of the box
- Stats Widget — Dashboard overview of promotion metrics
Requirements
- PHP 8.4+
- Laravel 12+
- Filament 5.0+
- aiarmada/promotions package
Installation
composer require aiarmada/filament-promotions
Register the plugin in your Filament panel:
use AIArmada\FilamentPromotions\FilamentPromotionsPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentPromotionsPlugin::make(), ]); }
Optionally publish the config:
php artisan vendor:publish --tag=filament-promotions-config
Configuration
// config/filament-promotions.php return [ 'navigation_group' => 'Marketing', 'resources' => [ 'navigation_sort' => [ 'promotions' => 10, ], ], 'tables' => [ 'poll' => null, ], 'features' => [ 'widgets' => true, ], ];
Usage
Managing Promotions
The plugin provides a PromotionResource with:
- List View — Table with search, filters, and bulk actions
- Create View — Form to create new promotions
- Edit View — Update existing promotions
- View View — Detailed promotion information
Promotion Types
The Filament-aware PromotionType enum includes:
| Type | Label | Icon | Color |
|---|---|---|---|
Percentage |
Percentage Off | receipt-percent | success |
Fixed |
Fixed Amount | currency-dollar | info |
BuyXGetY |
Buy X Get Y | gift | warning |
Stats Widget
Add the stats widget to your dashboard:
use AIArmada\FilamentPromotions\Widgets\PromotionStatsWidget; public function panel(Panel $panel): Panel { return $panel ->widgets([ PromotionStatsWidget::class, ]); }
Multi-tenancy
The resource respects owner scoping from the promotions package. Configure in config/promotions.php:
'features' => [ 'owner' => [ 'enabled' => true, 'include_global' => true, ], ],
License
MIT License. See LICENSE for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-21