Skip to content

Instantly share code, notes, and snippets.

@vojtasvoboda
Last active July 13, 2017 18:50
Show Gist options
  • Save vojtasvoboda/dcfe5ef84771dd1a4f77c4e03e84bfe8 to your computer and use it in GitHub Desktop.
Save vojtasvoboda/dcfe5ef84771dd1a4f77c4e03e84bfe8 to your computer and use it in GitHub Desktop.
Spark with team billing and without
<?php namespace App\Http\Controllers;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
// with Team billing it should be teamSubscribed
$this->middleware('subscribed');
}
}
<?php namespace App\Providers;
class SparkServiceProvider extends ServiceProvider
{
public function booted()
{
// without Team billing
Spark::useStripe()->noCardUpFront()->trialDays(10);
Spark::freePlan()
->features([
'First', 'Second', 'Third'
]);
Spark::plan('Basic', 'provider-id-1')
->price(10)
->features(['First', 'Second', 'Third']);
// with Team billing
Spark::useStripe()->noCardUpFront()->teamTrialDays(10);
Spark::freeTeamPlan()
->features([
'First', 'Second', 'Third'
]);
Spark::teamPlan('Basic', 'provider-id-1')
->price(10)
->features(['First', 'Second', 'Third']);
}
}
<?php namespace App;
// with Team billing
use Laravel\Spark\CanJoinTeams;
class User extends SparkUser
{
// with Team billing
use CanJoinTeams;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment