[16.x] Flexible Billing Support for Laravel Cashier #1772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces comprehensive Flexible Billing support to Laravel Cashier, enabling modern usage-based billing models, billing credits, and advanced subscription management that aligns with Stripe's latest Basil API capabilities.
What is Flexible Billing?
Flexible Billing represents the future of subscription commerce, moving beyond traditional fixed-price subscriptions to support:
Flexible Billing Features
1. Usage-Based Billing (
ManagesUsageBilling
trait)2. Billing Credits Management (
ManagesBillingCredits
trait)3. Advanced Subscription Scheduling for Flexible Billing
4. Real-World Flexible Billing Use Cases
This implementation enables modern SaaS pricing models:
Flexible Billing Infrastructure
Enhanced Database Schema for Usage Billing
meter_id
andmeter_event_name
columns tosubscription_items
tablemetadata
JSON column tosubscription_schedules
tableStripe API Modernization
flexible
vsclassic
billing modesAdvanced Subscription Management
Testing
Breaking Changes
Minor Breaking Changes
Migration to Flexible Billing
Enable Flexible Billing Features
Implement Usage-Based Pricing
Create Flexible Subscriptions
Documentation Updates Needed
Key achievements:
This enables Laravel applications to compete with modern SaaS pricing models and unlock new revenue opportunities through flexible, usage-based billing.
/cc @taylorotwell @driesvints @crynobone