Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Conditionable trait to subscription builder #1573

Conversation

maartenpaauw
Copy link
Contributor

Example code:

return $tenant->newSubscription($plan, $priceId)
    ->allowPromotionCodes()
    ->when($trailDays, fn (SubscriptionBuilder $builder) => $builder->trialUntil(Carbon::now()->endOfDay()->addDays($trialDays)))
    ->collectTaxIds()
    ->checkout([
        'success_url' => Dashboard::getUrl(),
        'cancel_url' => Dashboard::getUrl(),
    ])
    ->redirect();

@taylorotwell taylorotwell merged commit d5319c3 into laravel:14.x Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants