@include('layouts.partials.app-logo') @php $hora = now()->hour; $saludoHdr = match(true) { $hora < 12 => __('dashboard.good-morning'), $hora < 19 => __('dashboard.good-afternoon'), default => __('dashboard.good-evening'), }; $primerNombre = \Illuminate\Support\Str::before(auth()->user()->name ?? 'Usuario', ' '); @endphp {{ $saludoHdr }}, {{ $primerNombre }}
{{ now()->locale(app()->getLocale())->isoFormat('ddd D MMM YYYY') }}
@php $_notifUnread = auth()->check() ? \App\Modules\Admin\Models\Notification::where('user_id', auth()->id())->where('is_read', false)->count() : 0; @endphp @include('layouts.partials.app-notifications') @php $authUser = auth()->user(); $authNombre = $authUser->name ?? 'Usuario'; $authEmail = $authUser->email ?? ''; $authApellido = $authUser->profile->apellido_paterno ?? ''; // Iniciales para el avatar $iniciales = strtoupper( substr($authNombre, 0, 1) . substr($authApellido, 0, 1) ); // Colores para el avatar de iniciales $colores = ['#E74C3C','#E67E22','#2ECC71','#1ABC9C','#3498DB','#9B59B6','#E91E63','#00BCD4','#FF5722','#607D8B','#795548']; $hash = 0; foreach (str_split($authNombre . $authApellido) as $char) { $hash = ord($char) + (($hash << 5) - $hash); } $colorAvatar = $colores[abs($hash % count($colores))]; @endphp