This package provides a Filament administrative interface for the banulakwin/laravel-pricing package. It manages the CRUD operations for Coupon models natively integrating with Filament's UI patterns.
php artisan boost:add-skill banulakwin/filament-pricing
Save this content to: AGENTS.md
# Agent Documentation: `banulakwin/filament-pricing-admin`
## Overview
This package provides a Filament administrative interface for the `banulakwin/laravel-pricing` package. It manages the CRUD operations for `Coupon` models natively integrating with Filament's UI patterns.
## Core Concepts
- **`CouponResource`**: Central Filament resource managing Coupons.
- **`CouponForm`**: Uses Repeaters to manage `items` (polymorphic morph targets) and `users` relationship data. Uses dynamic options loading for the `couponable_id` based on the selected `couponable_type`.
- **`CouponInfolist`**: Presents coupon details using `RepeatableEntry` components to display the linked targeted items and users.
- **`CouponsTable`**: Displays coupon aggregations (e.g., "Global" vs "X targets" and "All users" vs "Y users") cleanly.
## Configuration Alignment
- **`couponable_types`**: The morph types defined in `config/pricing.php` and `config/filament-pricing-admin.php` dictate the available types in the target repeater. Example:
```php
'couponable_types' => [
'App\\Models\\Movie' => 'Movie',
'App\\Models\\TvShow' => 'TV Show',
]
```
- **`coupon_user`**: Defines how user records are searched, formatted, and displayed within the `users` restriction Repeater.
## Implementation Notes
- Repeaters for `items` and `users` use `->relationship()` to natively handle database syncing for the `coupon_items` and `coupon_users` pivot tables.
- Fixed/Percentage values and constraints (max uses, expiry, first-time only) are toggled intuitively via the main schema fields.
banulakwin/filament-pricing-adminThis package provides a Filament administrative interface for the banulakwin/laravel-pricing package. It manages the CRUD operations for Coupon models natively integrating with Filament's UI patterns.
CouponResource: Central Filament resource managing Coupons.CouponForm: Uses Repeaters to manage items (polymorphic morph targets) and users relationship data. Uses dynamic options loading for the couponable_id based on the selected couponable_type.CouponInfolist: Presents coupon details using RepeatableEntry components to display the linked targeted items and users.CouponsTable: Displays coupon aggregations (e.g., "Global" vs "X targets" and "All users" vs "Y users") cleanly.couponable_types: The morph types defined in config/pricing.php and config/filament-pricing-admin.php dictate the available types in the target repeater. Example:
'couponable_types' => [
'App\\Models\\Movie' => 'Movie',
'App\\Models\\TvShow' => 'TV Show',
]
coupon_user: Defines how user records are searched, formatted, and displayed within the users restriction Repeater.items and users use ->relationship() to natively handle database syncing for the coupon_items and coupon_users pivot tables.How can I help you explore Laravel packages today?