- How do I install this package in a Laravel 13 + Filament 5 project?
- Run `composer require maartenpaauw/filament-cashier-billing-provider`, ensure your tenant model implements `HasSubscription`, and configure Stripe keys in `.env` with `CASHIER_STRIPE_KEY` and `CASHIER_STRIPE_SECRET`. Verify your `Billable` model matches Filament’s tenant model.
- Does this package support one-time payments or invoices?
- No, this package is designed exclusively for recurring subscriptions via Laravel Cashier. For one-time payments or invoices, you’ll need a custom solution or an alternative package.
- Can I use PayPal or other payment gateways instead of Stripe?
- This package is tightly coupled with Laravel Cashier and Stripe. While Cashier supports multiple gateways, the Filament integration assumes Stripe. Custom middleware or a different package would be required for PayPal.
- How do I configure subscription plans in Filament?
- Define plans in `config/cashier.php` under the `plans` key, specifying `price_id`, `product_id`, and optional settings like `trial_days` or `metered_price`. The package automatically surfaces these in Filament’s tenant management UI.
- What Laravel and Filament versions are supported?
- The package requires Laravel 12/13 and Filament 4/5. Laravel 11 support was dropped in v3.1.0. Always pin Filament to a specific minor version (e.g., `^5.0`) to avoid compatibility issues during auto-updates.
- How do I restrict access to non-subscribed tenants?
- Use the `RedirectIfUserNotSubscribed` middleware in your Filament routes or panel configuration. This middleware checks if the tenant’s subscription is active before granting access.
- Can I use metered pricing (usage-based billing) with this package?
- Yes, the package supports metered pricing by setting `metered_price` to `true` in your `cashier.php` plan configuration. Ensure your Stripe price IDs are configured for metered billing in the Stripe dashboard.
- How do I handle Stripe webhooks for subscription events like cancellations?
- Laravel Cashier provides built-in webhook handling for subscription events. Ensure your `routes/web.php` includes the Cashier webhook route (`cashier/webhook`) and configure Stripe’s webhook endpoint to point to your Laravel app. Custom logic can be added via Cashier’s event listeners.
- Will this package work if my tenant model isn’t the same as the Billable model?
- No, the package assumes your Filament tenant model is the same as the `Billable` model (e.g., `User` or `Tenant`). If they differ, you’ll need to extend the package or create a custom mapping to bridge the two models.
- Are there any known conflicts with Filament’s built-in middleware or authentication?
- The `RedirectIfUserNotSubscribed` middleware is designed to work alongside Filament’s auth system, but conflicts can occur if multiple middleware enforce similar checks. Test thoroughly in staging, especially if using custom Filament middleware.