@php // Helper local para construir URL de sort manteniendo filtros $sortLink = function ($col) use ($sortCol, $sortDir) { $newDir = ($sortCol === $col && $sortDir === 'desc') ? 'asc' : 'desc'; return request()->fullUrlWithQuery(['sort' => $col, 'dir' => $newDir]); }; $sortIcon = function ($col) use ($sortCol, $sortDir) { if ($sortCol !== $col) return ''; return $sortDir === 'asc' ? '' : ''; }; $exportUrl = request()->fullUrlWithQuery(['export' => null]); $exportUrl = preg_replace('#^[^?]*#', route('admin.customers.export'), $exportUrl); @endphp
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Stats --}}
{{ $stats['total'] }}
Total users
{{ $stats['clients'] }}
Clients
{{ $stats['admins'] }}
Admins
{{ $stats['unverified'] }}
Email no verificado
{{-- Filtros --}}
@if($search || $roleFilt || $verified !== null || $registeredFrom || $registeredTo || $lastLoginFilt) Limpiar @endif
{{-- Preserve sort en submits del form --}}
{{-- Tabla con bulk actions --}}
@csrf

Resultados {{ $users->total() }}

{{-- Bulk actions bar (visible cuando hay selección) --}}
0 seleccionados
@forelse($users as $u) @empty @endforelse
Email {!! $sortIcon('email') !!} Nombre {!! $sortIcon('first_name') !!} Roles Verif. {!! $sortIcon('email_verified_at') !!} Proy. {!! $sortIcon('projects_count') !!} Registrado {!! $sortIcon('created_at') !!} Último login {!! $sortIcon('last_login_at') !!} Acciones
@if($u->id !== auth()->id()) @else @endif {{ $u->email }} @if(\Illuminate\Support\Str::startsWith($u->email, 'stress_')) stress @endif {{ trim(($u->first_name ?? '') . ' ' . ($u->last_name ?? '')) ?: '—' }} @foreach($u->roles as $role) {{ $role->name }} @endforeach @if($u->email_verified_at) @else @endif @if($u->projects_count > 0) {{ $u->projects_count }} @else @endif {{ $u->created_at?->format('d/m/Y') ?? '—' }} {{ $u->created_at?->diffForHumans() ?? '' }} @if($u->last_login_at) {{ \Carbon\Carbon::parse($u->last_login_at)->format('d/m/Y') }} {{ \Carbon\Carbon::parse($u->last_login_at)->diffForHumans() }} @else Nunca @endif
Sin resultados con esos filtros.
@if(request()->hasAny(['q', 'role', 'verified', 'from', 'to', 'last_login'])) Limpiar filtros @endif
{{ $users->links() }}
@push('scripts') @endpush