diff --git a/resources/views/components/sidebar.blade.php b/resources/views/components/sidebar.blade.php index c5dea57..2c2ce74 100644 --- a/resources/views/components/sidebar.blade.php +++ b/resources/views/components/sidebar.blade.php @@ -58,12 +58,23 @@ : (Auth::check() && Auth::user()->name ? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode(Auth::user()->name) . '&backgroundColor=e2e8f0' : asset('images/avatar.png')); + + $deptName = 'Product Team'; + if (Auth::check()) { + $deptVal = Auth::user()->departments; + if (is_numeric($deptVal)) { + $idx = ((int)$deptVal) - 1; + $deptName = config('constants.DEPARTMENTS')[$idx] ?? 'Team'; + } else { + $deptName = $deptVal ?? 'Team'; + } + } @endphp Avatar
{{ Auth::check() ? (Auth::user()->name ?? 'Nguyễn Minh Anh') : 'Nguyễn Minh Anh' }} - {{ Auth::check() ? (Auth::user()->role == config('constants.ROLE_ADMIN') ? 'Administrator' : 'Product Team') : 'Product Team' }} + {{ $deptName }}