Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maartenpaauw/filament-cashier-billing-provider
Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.
https://github.com/maartenpaauw/filament-cashier-billing-provider
billing-provider cashier filamentphp laravel stripe
Last synced: 16 days ago
JSON representation
Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.
- Host: GitHub
- URL: https://github.com/maartenpaauw/filament-cashier-billing-provider
- Owner: maartenpaauw
- License: mit
- Created: 2023-09-23T17:20:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-02T13:28:15.000Z (9 months ago)
- Last Synced: 2024-04-03T09:33:41.011Z (9 months ago)
- Topics: billing-provider, cashier, filamentphp, laravel, stripe
- Language: PHP
- Homepage: https://filamentphp.com/plugins/maartenpaauw-cashier-billing-provider
- Size: 51.8 KB
- Stars: 41
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Filament billing provider for Laravel Cashier
[![Latest Version on Packagist](https://img.shields.io/packagist/v/maartenpaauw/filament-cashier-billing-provider.svg?style=flat-square)](https://packagist.org/packages/maartenpaauw/filament-cashier-billing-provider)
[![Tests](https://img.shields.io/github/actions/workflow/status/maartenpaauw/filament-cashier-billing-provider/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/maartenpaauw/filament-cashier-billing-provider/actions/workflows/run-tests.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/maartenpaauw/filament-cashier-billing-provider.svg?style=flat-square)](https://packagist.org/packages/maartenpaauw/filament-cashier-billing-provider)Integrate Laravel Cashier Stripe support into Filament's multi-tenant panels.
## Support me
You can support me by [buying Model States for Filament](https://filamentphp.com/plugins/maartenpaauw-model-states).
## Installation
1. Install the package via composer:
```bash
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](https://laravel.com/docs/11.x/billing#billable-model).## Usage
Add plans to your `cashier.php` config file:
```php
'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):
```php
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
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Upgrading
Please see [UPGRADING](UPGRADING.md) for more details.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Maarten Paauw](https://github.com/maartenpaauw)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.