Skip to content

Instantly share code, notes, and snippets.

@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' => [

##Team Dropdown for Laravel Spark

Maybe you want a way for users to quickly jump to team settings?

Can be placed anywhere, try it out on user-right.blade.php Laravel Spark Team Dropdown

<?php $currentTeam = auth()->user()->currentTeam; ?>
@dillinghamio
dillinghamio / laravel-spark-rotating-pricing-table.md
Last active August 13, 2019 13:53
Laravel Spark Pricing Table

Rotating Pricing Table for Laravel Spark

Can be placed anywhere, try it out on welcome.blade.php


Laravel Spark Pricing Table ###If you're using team plans just swap out $sparkPlans = Spark::plans(); with $sparkPlans = Spark::teamPlans();


@dillinghamio
dillinghamio / gist:056dc42f9238ce0005ef
Last active August 29, 2015 14:06
Add Selectable Indentation for code output dynamically.
var indentElements = $('[class*="tab-"]');
$.each(indentElements, function (index) {
var indentAmount = parseInt(this.className.split('-')[1]);
var indentation = new Array(indentAmount + 1).join('&nbsp;&nbsp;&nbsp;&nbsp;');
this.innerHTML = indentation + this.innerHTML
});