{{-- In-app paywall โ€” a slide-up bottom sheet shown over a feature page when the current workspace's plan does NOT include that feature. Shows the actual plan CARDS that unlock it so the operator can pick + upgrade. Source of the required feature: 1. View::share('planPaywall', ...) set by EnforcePlanFeature on plan:-gated routes (calling / AI), OR 2. the config/plan_gates.php URL-path map. Platform admins, unlocked plans, and non-mapped pages render nothing. No inline JS โ€” links only; the slide-up is a CSS keyframe in wadesk.css. --}} @php $u = auth()->check() ? auth()->user() : null; $ws = $u?->currentWorkspace; $isAdmin = false; if ($u) { try { $isAdmin = $u->hasRole('Super Admin') || $u->hasRole('Admin'); } catch (\Throwable $e) { } if (!$isAdmin) { $isAdmin = in_array($u->role ?? null, ['admin', 'A', 'super-admin', 'platform-admin'], true); } } $shared = \Illuminate\Support\Facades\View::shared('planPaywall'); $feature = is_array($shared) ? $shared['feature'] ?? null : null; $label = is_array($shared) ? $shared['label'] ?? null : null; if (!$feature) { foreach ((array) config('plan_gates', []) as $pattern => $feat) { if (request()->is($pattern)) { $feature = $feat; break; } } } $show = false; $plans = collect(); if ($u && $ws && $feature && !$isAdmin) { if (!\App\Services\PlanLimitGuard::hasFeature($ws, $feature)) { $show = true; $label = $label ?: ucfirst(str_replace(['access_', '_'], ['', ' '], $feature)); try { if (\Illuminate\Support\Facades\Schema::hasColumn('packages', $feature)) { $plans = \App\Models\Package::where('status', 1) ->where($feature, 1) ->orderBy('sort_order') ->orderBy('plan_amount') ->get(); } } catch (\Throwable $e) { } } } $plansUrl = \Illuminate\Support\Facades\Route::has('account.plans') ? route('account.plans') : url('/account/plans'); @endphp @if ($show)
{{ __('Premium feature') }}

{{ ucfirst($label) }} {{ __('is not on your plan') }}

{{ __('Pick a plan below that includes it โ€” upgrade and unlock this feature instantly.') }}

@if ($plans->count())
@foreach ($plans as $p) @php $isFree = $p->free || (float) $p->plan_amount === 0.0; $isCustom = (bool) $p->is_custom_quote; $sym = html_entity_decode($p->currency_symbol ?? '$', ENT_QUOTES, 'UTF-8'); $price = $isCustom ? __('Custom') : ($isFree ? __('Free') : $sym . number_format((float) $p->plan_amount, 0)); $cta = $isCustom ? url('/support') : ($isFree ? $plansUrl : route('user.checkout.show', $p->id)); $hot = (bool) $p->is_highlighted; @endphp
$hot, 'border-paper-200 bg-paper-0' => !$hot, ])> @if ($hot) {{ __('Popular') }} @endif
{{ $p->pname }}
{{ $price }} @if (!$isFree && !$isCustom) / {{ __('mo') }} @endif
@if ($p->subtitle)

{{ \Illuminate\Support\Str::limit($p->subtitle, 70) }}

@endif $hot || !$isFree, 'border border-paper-200 bg-paper-0 hover:bg-paper-50 text-ink-700' => $isFree && !$hot, ])> {{ $isCustom ? __('Talk to sales') : ($isFree ? __('Continue free') : __('Choose :plan', ['plan' => $p->pname])) }}
@endforeach
@endif
@endif