{{-- Who is signed in, and what belongs to them rather than to a page: an avatar that opens a menu. `name` and `email` head the menu; `avatar` is an image URL or, by default, the initials of the name. The slot holds the items (``: settings, billing…), a theme item follows unless `:theme="false"`, and the `footer` slot comes last, after a separator — the place for signing out, furthest from the thumb:
@csrf
`label` names the button and the menu ("Account"). `position` as on `` (`bottom-end`). --}} @props([ 'name' => null, 'email' => null, 'avatar' => null, 'label' => null, 'theme' => true, 'position' => 'bottom-end', ]) @php $label ??= __('Account'); $image = filled($avatar) && (str_contains((string) $avatar, '/') || str_contains((string) $avatar, '.')); $initials = $image ? null : ($avatar ?? \Illuminate\Support\Str::of((string) $name)->explode(' ')->filter()->take(2)->map(fn (string $word): string => mb_strtoupper(mb_substr($word, 0, 1)))->join('')); @endphp @if (filled($name) || filled($email))
@if (filled($name))

{{ $name }}

@endif @if (filled($email))

{{ $email }}

@endif
@endif {{ $slot }} @if ($theme) {{ __('Theme') }} @endif @isset($footer) {{ $footer }} @endisset