Spark does not have built-in support for variable seat costs or graduated pricing. However, you can achieve this functionality by customizing Spark and integrating with Stripe.
One possible solution is to create a base subscription plan for the Team Owner license with a flat cost of $15. Then, you can create additional subscription plans for the Team Member license with a cost of $8.
To automatically apply a discount to every seat after the first subscription, you can use Stripe's coupon feature. You can create a coupon in Stripe with a discount amount of $7 (the difference between the Team Owner and Team Member license costs). Then, when a user adds an additional seat, you can apply this coupon to their subscription.
Here's an example of how you can implement this in Laravel Spark:
- Create the subscription plans in Stripe:
// Create the base plan for Team Owner
$teamOwnerPlan = Stripe::plans()->create([
'amount' => 1500, // in cents
'interval' => 'month',
'product' => [
'name' => 'Team Owner',
'type' => 'service',
],
]);
// Create the plan for Team Member
$teamMemberPlan = Stripe::plans()->create([
'amount' => 800, // in cents
'interval' => 'month',
'product' => [
'name' => 'Team Member',
'type' => 'service',
],
]);
- Create a coupon in Stripe with a $7 discount:
$coupon = Stripe::coupons()->create([
'amount_off' => 700, // in cents
'currency' => 'usd',
'duration' => 'forever',
]);
- When a user adds an additional seat, apply the coupon to their subscription:
$user = Auth::user();
// Create a new subscription for the additional seat
$subscription = $user->newSubscription('default', $teamMemberPlan->id)->create();
// Apply the coupon to the subscription
$subscription->applyCoupon($coupon->id);
This way, the user will be charged $15 for the first seat and $8 for each additional seat, with a $7 discount applied to each additional seat.
Note: This solution assumes you have already set up Laravel Spark and integrated it with Stripe. You may need to adjust the code to fit your specific implementation.