liberusoftware/filament-cashier-billing-provider

Filament billing provider for Laravel Cashier

1.3 2024-02-27 21:21 UTC

This package is not auto-updated.

Last update: 2024-04-24 20:11:28 UTC


README

Latest Version on Packagist Tests Total Downloads

Add Laravel Cashier Stripe support to Filament multi tenant panels.

Support me

68747470733a2f2f66696c616d656e747068702e636f6d2f696d616765732f636f6e74656e742f706c7567696e732f696d616765732f6d61617274656e70616175772d70656e6e616e742e77656270

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' => [
    'basic' => [
        'price_id' => ENV('CASHIER_STRIPE_SUBSCRIPTION_BASIC_PRICE_ID'),
        'trial_days' => 14, // Optional
        'collect_tax_ids' => false, // Optional
    ],
],

Warning 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('basic'))
        ->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.