{{ __('Manage Users') }}
{{ __('User Directory') }}
@can('create-user') @endcan
Show entries
@forelse ($users as $user) @php $initials = mb_strtoupper(mb_substr($user->name ?? '', 0, 1, 'UTF-8'), 'UTF-8'); $colors = ['#4f46e5','#0ea5e9','#16a34a','#ea580c','#dc2626','#7c3aed','#0891b2','#ca8a04']; $bgColor = $colors[abs(crc32($user->email)) % count($colors)]; @endphp
{{-- Top Action Corner / Badges --}}
@if($user->id === Auth::id()) You @endif
{{-- Avatar + Identity Header --}}
@if($user->profile_photo_path) {{ $user->name }} @else
{{ $initials }}
@endif
{{ $user->name }}
@foreach ($user->getRoleNames() as $role) {{ $role }} @endforeach
{{-- User Details --}}
{{ $user->email }}
{{ $user->mobile ?? 'N/A' }}
{{ $user->address ?? 'No Address' }}
{{-- Permissions List --}}
Permissions:
@if (in_array('Super Admin', $user->getRoleNames()->toArray() ?? [])) All Permissions @else @php $userPermissions = $user->getAllPermissions(); $permCount = $userPermissions->count(); @endphp @forelse ($userPermissions->take(6) as $permission) {{ $permission->name }} @empty No Permissions @endforelse @if ($permCount > 6) +{{ $permCount - 6 }} more @endif @endif
{{-- Actions Footer --}}
@if (in_array('Super Admin', $user->getRoleNames()->toArray() ?? []) ) @if (Auth::user()->hasRole('Super Admin')) @if (Auth::user()->id == $user->id) @endif @else System Protected @endif @else @can('edit-user') @endcan @can('delete-user') @if (Auth::user()->id != $user->id) @endif @endcan @endif
@empty
No Users Found!
@endforelse
{{ $users->links() }}
@include('livewire.admin.user.user-form')