To implement a pricing model in Laravel Spark where customers start with an initial $99 signup fee and then renew at $199 per annum, you can follow these steps:
-
Create Two Plans: Define two separate plans in your billing provider (e.g., Stripe or Paddle) and in your Laravel Spark configuration. One plan will be for the initial signup fee, and the other for the annual renewal.
-
Initial Subscription: When a customer signs up, subscribe them to the initial $99 plan. This can be done using Spark's subscription methods.
-
Schedule Plan Change: After the initial subscription, you need to schedule a change to the $199 plan. This can be achieved by listening to the billing cycle events and updating the subscription accordingly.
Here's a basic example of how you might implement this in your Laravel application:
use Laravel\Spark\Spark;
use Laravel\Cashier\Subscription;
// When a user subscribes
$user->newSubscription('default', 'initial-plan-id')->create($paymentMethod);
// Listen for the subscription renewal event
Event::listen('Laravel\Cashier\Events\SubscriptionRenewed', function (Subscription $subscription) {
if ($subscription->stripe_plan === 'initial-plan-id') {
// Change the plan to the annual renewal plan
$subscription->swap('annual-plan-id');
}
});
-
Testing: Ensure you thoroughly test this setup in a sandbox environment to confirm that the plan changes correctly after the initial period.
-
Communication: Inform your customers about the pricing structure clearly during the signup process to avoid any confusion.
This approach leverages Laravel Spark's and Cashier's capabilities to manage subscriptions and plan changes effectively. Adjust the plan IDs and logic as necessary to fit your specific billing provider and application requirements.