Coupons
CommunityA flexible coupon management system with customizable strategies and usage tracking.
Author:
Noxo
Package health
BetaAutomated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Failed: Dependabot PR responsiveness — Stale Dependabot PRs: oldest general PR is 386 days old. View details on Plumb
- Skipped: Renovate MR responsiveness
- Passed: Dependabot or Renovate configured
-
Failed:
Dependency update cooldown configured
—
No cooldown configured in
.github/dependabot.yml. View details on Plumb - Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Failed: Commit and release recency — Inactive: last commit 425 days ago; last release 441 days ago. View details on Plumb
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Warning:
Current Laravel version supported
—
Package support for current Laravel
13.0could not be verified; the newest co-installable line is12.0, which receives security patches only (until 2027-02-24). Line13.0could not be fully verified: no solution was found among the newest package versions, and resolving the complete version pool exceeded solver resource budgets, so support there cannot be ruled out. -
Passed:
Current PHP version supported
—
Constraint
^8.1supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation

A flexible coupon management system for Filament 3.x with customizable strategies and usage tracking.
#Installation
composer require noxoua/filament-coupons
php artisan filament-coupons:install
#Setup
Add the plugin to your Filament panel:
use Noxo\FilamentCoupons\CouponsPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
CouponsPlugin::make(),
]);
}
#Usage
#Creating Strategies
Create custom coupon strategies:
php artisan make:coupons-strategy FreeSubscription
Register in config:
// config/filament-coupons.php
'strategies' => [
\App\Coupons\FreeSubscriptionStrategy::class,
],
#Strategy Example
class FreeSubscriptionStrategy extends CouponStrategy
{
public function schema(): array
{
return [
Forms\Components\TextInput::make('days')
->label('Days')
->numeric()
->required(),
];
}
public function apply(Coupon $coupon): bool
{
$user = auth()->user();
$days = $coupon->payload['days'] ?? 7;
// Your business logic
$user->extendSubscription($days);
// Configure notifications and redirects
$this->successNotification(
fn ($notification) => $notification
->title('Coupon Applied!')
->body("You got {$days} free days")
);
$this->successRedirectUrl('/dashboard');
// Consume coupon
return coupons()->consume($coupon, couponable: $user);
}
}
Available methods for strategies:
- Custom notifications
successNotificationfailureNotification
- Custom redirects
successRedirectUrlfailureRedirectUrl
#Using the Action
The package provides a ready-to-use ApplyCouponAction that can be integrated anywhere in your Filament application:
In Livewire Components:
use Noxo\FilamentCoupons\Actions\ApplyCouponAction;
class Dashboard extends Component implements HasActions
{
use InteractsWithActions;
public function applyCouponAction(): Action
{
return ApplyCouponAction::make()
->button()
->label('Apply Coupon');
}
public function render()
{
return view('dashboard');
}
}
{{-- dashboard.blade.php --}}
<div>
<h2>Dashboard</h2>
{{ $this->applyCouponAction }}
</div>
In Resource Pages:
use Noxo\FilamentCoupons\Actions\ApplyCouponAction;
class ListPosts extends ListRecords
{
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
ApplyCouponAction::make(),
];
}
}
In Custom Pages:
use Noxo\FilamentCoupons\Actions\ApplyCouponAction;
class SettingsPage extends Page
{
protected function getHeaderActions(): array
{
return [
ApplyCouponAction::make()
->label('Redeem Coupon')
->color('success'),
];
}
}
#Manual Using
$coupon = Coupon::where('code', 'WELCOME2012')->first();
// Validate
if (coupons()->isValid($coupon)) {
// Apply
coupons()->applyCoupon($coupon);
}
#Testing
Run the test suite using:
composer test
The tests verify all aspects of coupon functionality, including strategy handling and integration with Filament. We recommend running tests after any changes.
#Credits
#License
The MIT License (MIT). Please see License File for more information.
The author
From the same author
Featured Plugins
A selection of plugins curated by the Filament team
Noir Theme
A theme that gives panels a focused, refined look with near-black surfaces, crisp actions, and restrained color.
Filament
Soft Theme
A theme that gives panels a warm, approachable look with rounded shapes, gentle colors, and serif headings.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese