Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.
You can support me by buying Model States for Filament.
-
Install the package via composer:
composer require maartenpaauw/filament-cashier-billing-provider
-
Make sure your
Billablemodel is the same as your Filament tenant model.
Tip
For more information configuring a Billable model, refer to the official
Laravel documentation.
Add plans to your cashier.php config file:
'plans' => [
'default' => [
'product_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_DEFAULT_PRODUCT_ID'),
'price_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_DEFAULT_PRICE_ID'),
'type' => 'default', // Optional, by default it uses the array key as type.
'trial_days' => 14, // Optional
'has_generic_trial' => true, // Optional, only `trial_days` OR `has_generic_trial` can be used.
'allow_promotion_codes' => true, // Optional
'collect_tax_ids' => true, // Optional
'metered_price' => 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.
composer testPlease see CHANGELOG for more information on what has changed recently.
Please see UPGRADING for more details.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.