Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Cashier Billing Provider Laravel Package

maartenpaauw/filament-cashier-billing-provider

Integrate Laravel Cashier Stripe subscriptions into Filament multi-tenant panels. Configure plans in cashier.php and make your Billable model the tenant model; supports recurring subscriptions, trials, promo codes, tax IDs, and metered prices.

View on GitHub
Deep Wiki
Context7

Filament billing provider for Laravel Cashier

Latest Version on Packagist Tests Total Downloads

Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.

Support me

You can support me by buying Model States for Filament.

Installation

  1. Install the package via composer:

    composer require maartenpaauw/filament-cashier-billing-provider
    
  2. Make sure your Billable model is the same as your Filament tenant model.

[!TIP] For more information configuring a Billable model, refer to the official Laravel documentation.

Usage

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.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Upgrading

Please see UPGRADING for more details.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels