Coupons by Noxo
CommunityA flexible coupon management system with customizable strategies and usage tracking.
Author:
Noxo
Package health
Automated 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 415 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 454 days ago; last release 470 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
-
Passed:
Current Laravel version supported
—
Package dependencies resolve together with current Laravel
13.0. -
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
Blueprint
Filament Blueprint is a premium Laravel Boost extension that helps AI agents produce accurate, detailed implementation plans and security reports for Filament apps.
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
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament