Create a new subscription checkout
mainTo initiate a subscription, use the subscribe method on your billable model, passing the Lemon Squeezy variant ID.
Once the customer completes the checkout, a SubscriptionCreated webhook will automatically link the subscription to your billable model in the database. You can then access the subscription via the subscription() method.
use Illuminate
Route::get('/subscribe', function (Request $request) {
return $request->user()->subscribe('variant-id');
});
// After checkout, retrieve it:
$subscription = $user->subscription();