@php // Usage: $size = $size ?? 128; $profile = $user->profile ?? null; $hash = $profile->avatar_hash ?? null; $src = $hash ? asset("storage/avatars/{$user->id}/{$size}.webp?v={$hash}") : asset('img/default-avatar.webp'); $alt = $alt ?? ($user->username ?? 'avatar'); $class = $class ?? 'rounded-full'; @endphp {{ $alt }}