@auth
{{-- SIDEBAR --}}
@endauth
{{-- PAGE CONTENT --}}
@foreach(['success' => 'check-circle', 'error' => 'exclamation-triangle', 'info' => 'info-circle'] as $key => $icon)
@if(session($key))
@endif
@endforeach
@yield('content')
{{-- IMPERSONATION BANNER --}}
@auth
@if(session()->has(\App\Http\Controllers\ImpersonationController::SESSION_KEY))
@php
$realUser = \App\Models\User::find(session(\App\Http\Controllers\ImpersonationController::SESSION_KEY));
@endphp
Viewing as {{ auth()->user()->name }}
({{ auth()->user()->getRoleNames()->map(fn($r) => ucwords(str_replace('_',' ',$r)))->implode(', ') ?: 'no role' }})
@if($realUser)
— signed in as {{ $realUser->name }}
@endif
@endif
@endauth
{{-- FOOTER --}}
@auth