laravel-afterburner / subscriptions
Stripe subscription billing for Afterburner applications
Package info
github.com/laravel-afterburner/subscriptions
pkg:composer/laravel-afterburner/subscriptions
Requires
- php: ^8.2
- laravel-afterburner/jetstream: ^1.0|dev-master
- laravel/cashier: ^15.0
- laravel/framework: ^11.0
- livewire/livewire: ^3.5
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-05-29 15:15:49 UTC
README
Stripe subscription billing for Laravel Afterburner Jetstream. Each entity is the billable customer.
Installation
Local Development Setup
For local development, add the package as a path repository:
composer config repositories.afterburner-subscriptions path ../afterburner-subscriptions composer require laravel-afterburner/subscriptions:@dev
Quick Install
composer require laravel-afterburner/subscriptions php artisan afterburner:subscriptions:install
Add Afterburner\Subscriptions\Concerns\HasSubscriptions to App\Models\Team.
Register EnsureSubscriptionActive on authenticated web routes (middleware alias: subscription.active).
Documentation
See INSTRUCTIONS.md for the full build specification and host integration checklist.
Features
- 30-day auto trial on new entities (full product access during trial; no card required)
- Monthly and annual plans (admin-managed, Stripe-synced)
- Plan entitlements (limits + feature slugs) via
PlanEntitlements/$team->entitlements() SubscriptionEntitlementGatefor add-on packages to gate features by plan- Promotion codes (admin-managed, Stripe-synced, optional at checkout)
- Entity subscription manager with Stripe Checkout and billing portal
- Invoice history via Cashier
- Hard app block when subscription inactive
- Billing notification emails to owner, president, and treasurer
- Audit log entries for subscribe, payment failed, and cancellation (when host
AuditServiceis available)
Entitlement gating for add-on packages
Add-on packages (documents, voting, etc.) should not hard-require this package. Use SubscriptionEntitlementGate at routes, policies, navigation, and mutation points:
use Afterburner\Subscriptions\Support\SubscriptionEntitlementGate; // Feature slug check (allows during trial, when disabled, or when not installed) SubscriptionEntitlementGate::allows($team, 'documents'); // Numeric limit check SubscriptionEntitlementGate::withinLimit($team, 'max_storage_gb', $usedGb);
On teams using HasSubscriptions, convenience methods are also available:
$team->canAccessEntitlement('documents'); $team->withinAccessibleEntitlementLimit('max_storage_gb', $usedGb);
Route middleware (alias registered by this package):
Route::middleware('subscription.entitlement:documents')->group(...);
Laravel gate for policies:
$user->can('teamEntitlement', [$team, 'documents']);
Register each add-on's slug in the host config/afterburner-subscriptions.php → known_feature_slugs so admins can assign features to plans.
Trial behavior: With trial_full_access enabled (default), entities on a generic trial bypass entitlement checks so they can explore all features. After trial, access is enforced by the subscribed plan.
App-wide block: EnsureSubscriptionActive (host registers) blocks the entire app when billing is inactive. Entitlement checks are per-feature and complementary.
License
MIT License