@extends('layouts.app') @section('title', 'User Management') @section('content') @include('partials.flash')
search
person_add New User
@forelse($users as $user) @php $initials = collect(explode(' ', $user->name))->map(fn($n) => $n[0] ?? '')->take(2)->implode(''); $role = $user->roles->first()?->name; $roleBadge = match($role) { 'admin' => 'bg-primary/10 text-primary', 'hr' => 'bg-secondary-container text-on-secondary-container', 'trainer' => 'bg-surface-container-high text-secondary', default => 'bg-surface-container-high text-on-surface-variant', }; @endphp @empty @endforelse
User Role Location Joined Actions
{{ strtoupper($initials) }}

{{ $user->name }}

{{ $user->email }}

{{ $role ? (\App\Models\User::roleLabels()[$role] ?? \Illuminate\Support\Str::headline($role)) : 'No role' }} @php $loc = $user->locationLabel(); @endphp @if($loc) {{ $loc }} @else @endif {{ $user->created_at?->format('j M Y') }}
edit @if($user->id !== auth()->id())
@csrf @method('DELETE')
@else lock @endif
No users found. Add one.
{{ $users->links() }}
@endsection