maartenpaauw / filament-cashier-billing-provider
Filament billing provider for Laravel Cashier
Fund package maintenance!
filamentphp.com/plugins/maartenpaauw-pennant
Requires
- php: ^8.1
- filament/filament: ^3.0|^3.2.39
- illuminate/config: ^10.0|^11.0
- illuminate/http: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- laravel/cashier: ^14.12.7|^15.2
Requires (Dev)
- laravel/pint: ^1.0
- pestphp/pest: ^2.15
- spatie/ray: ^1.28
README
Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.
Support me
You can support me by buying Pennant feature flags for Filament.
Installation
You can install the package via composer:
composer require maartenpaauw/filament-cashier-billing-provider
Usage
Add plans to your cashier.php
config file:
'plans' => [ 'default' => [ 'price_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_DEFAULT_PRICE_ID'), 'trial_days' => 14, // Optional 'allow_promotion_codes' => true, // Optional 'collect_tax_ids' => true, // Optional ], ],
Caution
The current implementation only supports recurring subscriptions.
Add the following code to your AdminPanelProvider
(or other panel providers):
use Maartenpaauw\Filament\Cashier\Stripe\BillingProvider; // ... public function panel(Panel $panel): Panel { return $panel // ... ->tenantBillingProvider(new BillingProvider('default')) ->requiresTenantSubscription() // ... }
Note
Requiring tenant subscription is optional. You can remove ->requiresTenantSubscription()
if you wish.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.