From ec26c0a2052cc2789feba03d02a883f21dfba5ca Mon Sep 17 00:00:00 2001 From: = Date: Thu, 21 May 2026 13:20:27 +0000 Subject: [PATCH] Refactor: user in dashboard topbar and fix binding - Centralized user data retrieval in `dashboard-topbar.blade.php` by introducing `$user` variable. - Enhanced topbar dropdown with user details (name, email) and improved styling. - Fixed Livewire binding in roles-and-apps view by replacing `model` with `wire:model`. --- .../views/components/dashbord-topbar.blade.php | 16 ++++++++++++---- .../roles-and-apps/⚡index.blade.php | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/resources/views/components/dashbord-topbar.blade.php b/resources/views/components/dashbord-topbar.blade.php index 80fe909..2e09b1d 100644 --- a/resources/views/components/dashbord-topbar.blade.php +++ b/resources/views/components/dashbord-topbar.blade.php @@ -1,7 +1,9 @@ -@php use App\Enums\DefaultUserRole; @endphp +@php use App\Enums\DefaultUserRole; + $user = auth()->user(); +@endphp
- @if(auth()->user()?->hasRole(DefaultUserRole::Admin->value)) + @if($user?->hasRole(DefaultUserRole::Admin->value))

Admin Panel

@endif
@@ -14,10 +16,16 @@
- {{ auth()->user()->initials() }} + {{ $user->initials() }}
- + +
+

{{$user->name}}

+

{{$user->email}}

+
+
+
@csrf