@extends('layouts.app') @section('mobile-title', 'Users') @section('mobile-subtitle', 'Team access') @section('mobile-action-url', route('users.create')) @section('mobile-action-icon', 'person_add') @section('mobile-action-label', 'Add user') @section('content') @php $roleLabels = ['admin' => 'Admin', 'supervisor' => 'Site Manager', 'technician' => 'Technician']; $initials = fn ($name) => collect(explode(' ', $name))->filter()->map(fn ($part) => substr($part, 0, 1))->take(2)->implode(''); @endphp
Manage team members, roles, and project assignments.
Total Users
{{ number_format($userMetrics['total']) }}
Active Now
{{ number_format($userMetrics['active']) }}
Inactive Accounts
{{ number_format($userMetrics['inactive']) }}
| User | Contact | Role | Projects | Status | Actions |
|---|---|---|---|---|---|
|
{{ $initials($userRecord->name) }}
{{ $userRecord->name }}
{{ $userRecord->job_title ?: 'No title' }}
|
{{ $userRecord->email }} | {{ $roleLabels[$userRecord->role] ?? ucfirst($userRecord->role) }} | @if ($userRecord->isAdmin()) All Access @elseif ($projects->isNotEmpty()) {{ $projects->implode(', ') }}{{ $userRecord->assignedProjects->count() > 2 ? ' +' . ($userRecord->assignedProjects->count() - 2) : '' }} @else - @endif | {{ $userRecord->is_active ? 'Active' : 'Deactivated' }} | more_vert |
| No users found. | |||||