@php $allNavItems = [ [ 'route' => 'dashboard', 'activePattern' => 'dashboard', 'label' => 'Dashboard', 'icon' => 'home', 'roles' => ['admin', 'receptionist', 'mechanic'], ], [ 'route' => 'customers.index', 'activePattern' => 'customers.*', 'label' => 'Clientes', 'icon' => 'users', 'roles' => ['admin', 'receptionist'], ], [ 'route' => 'vehicles.index', 'activePattern' => 'vehicles.*', 'label' => 'Vehículos', 'icon' => 'truck', 'roles' => ['admin', 'receptionist'], ], [ 'route' => 'orders.index', 'activePattern' => 'orders.*', 'label' => 'Órdenes', 'icon' => 'clipboard', 'roles' => ['admin', 'receptionist', 'mechanic'], ], [ 'route' => 'inventory.index', 'activePattern' => 'inventory.*', 'label' => 'Inventario', 'icon' => 'box', 'roles' => ['admin', 'receptionist', 'mechanic'], ], [ 'route' => 'invoices.index', 'activePattern' => 'invoices.*', 'label' => 'Facturación', 'icon' => 'receipt', 'roles' => ['admin'], ], [ 'route' => 'appointments.index', 'activePattern' => 'appointments.*', 'label' => 'Citas', 'icon' => 'calendar', 'roles' => ['admin', 'receptionist'], ], [ 'route' => 'staff.index', 'activePattern' => 'staff.*', 'label' => 'Personal', 'icon' => 'user-group', 'roles' => ['admin', 'receptionist'], ], [ 'route' => 'ai.chat', 'activePattern' => 'ai.*', 'label' => 'Asistente de IA', 'icon' => 'sparkles', 'isAi' => true, 'roles' => ['admin', 'receptionist', 'mechanic'], ], ]; $userRole = match(Auth::user()->role) { 'mecanico' => 'mechanic', 'recepcionista' => 'receptionist', default => Auth::user()->role ?? 'receptionist' }; $navItems = array_filter($allNavItems, function ($item) use ($userRole) { return in_array($userRole, $item['roles']); }); @endphp
{{ substr(Auth::user()->name, 0, 1) }}

{{ Auth::user()->name }}

{{ ['admin' => 'Admin', 'mechanic' => 'Mecánico', 'receptionist' => 'Recepcionista', 'mecanico' => 'Mecánico', 'recepcionista' => 'Recepcionista'][Auth::user()->role] ?? Auth::user()->role }}

Configuración
@csrf