@extends('layouts.app') @section('title', 'Agents') @push('styles') @endpush @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Assigned Staff
{{ $stats['total'] }}
Active
{{ $stats['active'] }}
Primary Agents
{{ $stats['primary'] }}
Locations Without Agent
{{ $stats['locations_without_agent'] }}
@if($locationsNeedingAgent->count() > 0)
Some locations still need a primary agent. Until you assign one, nobody is accountable for what happens there.
@foreach($locationsNeedingAgent as $loc) {{ $loc->name }} @endforeach
@endif
@if($agents->count() > 0) @foreach($agents as $staff) @endforeach
Agent Role Location Status Actions
{{ strtoupper(substr($staff->user->name ?? 'U', 0, 1)) }}
{{ $staff->user->name ?? '—' }} @if($staff->is_location_primary) Primary @endif
{{ $staff->user->email ?? '' }}{{ $staff->title ? ' · ' . $staff->title : '' }}
@if($staff->customRole) {{ $staff->customRole->name }} @else {{ ucfirst($staff->role ?? 'viewer') }} @endif {{ $staff->location->name ?? '—' }} {{ $staff->is_active ? 'Active' : 'Inactive' }}
@if(!$staff->is_location_primary && $staff->location_id)
@csrf @method('PATCH')
@endif
@csrf @method('DELETE')
{{ $agents->links() }}
@else

No agents assigned yet.

Assign your first agent
@endif
@endsection