@php $user = Auth::user(); $koperasi = \App\Models\Koop::where('user_id', $user->id)->first(); $avatarText = $koperasi ? strtoupper( collect(explode(' ', $user->name)) ->filter(fn($word) => strlen($word) > 0) ->map(fn($word) => mb_substr($word, 0, 1)) ->take(3) ->implode('') ) : 'KDB'; @endphp @php $subscription = $koperasi->subscriptions() ->where('status','active') ->latest() ->first(); $package = $subscription ? strtolower($subscription->package->name) : 'trial'; @endphp
@yield('content')