Skip to content

Instantly share code, notes, and snippets.

View Max-Hutschenreiter's full-sized avatar

Max Hutschenreiter Max-Hutschenreiter

View GitHub Profile
@dillinghamio
dillinghamio / Laravel Spark Per Team User Subscription.md
Last active April 22, 2022 14:57
Per Team User Subscription in Laravel Spark

Per Team User Subscription in Laravel Spark

If you want the ability to charge a team owner based on how many members their team has, like $10/user/month, then you utilize the Laravel Cashier functionality of incrementing the quantity.

You listen for when a new team member is added and you increase the quantity of the subscription by the amount of users and also listen for when a team member is removed to downsize charges. - Not Braintree Compatible


Within EventServiceProvider.php
'Laravel\Spark\Events\Teams\TeamMemberAdded' => [