## Per Team User Subscription in [Laravel Spark](https://spark.laravel.com/) 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](https://laravel.com/docs/5.2/billing#subscription-quantity) --- ##### Within EventServiceProvider.php ```PHP 'Laravel\Spark\Events\Teams\TeamMemberAdded' => [ 'App\Listeners\UpdatePerUserCharge' ], 'Laravel\Spark\Events\Teams\TeamMemberRemoved' => [ 'App\Listeners\UpdatePerUserCharge' ], ``` ##### And add a new listener ```PHP team->users()->count(); $event->team->subscription()->updateQuantity($userCount); } } ``` --- Made by: [@dillinghamio](https://twitter.com/dillinghamio) Find More Awesome Spark Stuff [Here](https://github.com/spark-is-awesome/awesome-spark)