hasActiveSubscription() ?? false; } /** * Get the plans that are configured and available to purchase. * * @return array */ #[Computed] public function plans(): array { return Organization::availablePlans(); } /** * Start a Stripe Checkout session for the given plan. */ public function subscribe(string $plan): RedirectResponse { abort_if(Auth::guest(), 403); $this->plan = $plan; $this->validate([ 'plan' => ['required', Rule::in(array_keys(Organization::availablePlans()))], ], [ 'plan.in' => __('That plan is not available.'), ]); $organization = Auth::user()->currentOrganization()->first(); abort_if($organization === null, 403); return $organization->checkoutForPlan($this->plan)->redirect(); } }; ?>
{{ __('Plans and pricing') }} @if (session('billing.checkout_failed')) {{ session('billing.checkout_failed') }} @endif @if ($this->isSubscribed) {{ __('Your workspace already has an active subscription.') }} @else {{ __('Subscribe to unlock your todos, folders and notes.') }} @endif
@if ($this->isSubscribed) {{ __('Manage your subscription') }} @elseif (count($this->plans) === 0) {{ __('No plans are available right now. Please check back soon.') }} @else
@foreach ($this->plans as $key => $plan)
{{ $plan['name'] }}

{{ Organization::formatAmount($plan['amount']) }}

{{ __('Billed every :interval', ['interval' => $plan['interval']]) }}
  • {{ __('Unlimited todos and folders') }}
  • {{ __('Notes on every todo') }}
  • {{ __('Status, due dates and priorities') }}
@auth {{ $this->trialDays() > 0 ? __('Start :days-day free trial', ['days' => $this->trialDays()]) : __('Subscribe') }} @else {{ __('Create an account') }} @endauth
@endforeach
@if ($this->trialDays() > 0) {{ __('Your trial ends after :days days and you can cancel at any time.', ['days' => $this->trialDays()]) }} @endif @endif @error('plan') @enderror