@extends('layouts.app') @section('title', 'Manage Agents') @section('content')

Agent Management

Manage delivery agents and their assignments

Back to Dashboard Add New Agent
Search & Filters
Clear
Agents List ({{ $agents->total() }} total)
@if($agents->count() > 0)
@foreach($agents as $agent)
Agent Info Contact Details Vehicle Info Performance Status Joined Date Actions
{{ strtoupper(substr($agent->user->name, 0, 2)) }}
{{ $agent->user->name }}
{{ $agent->user->email }}
{{ $agent->agent_code }}
{{ $agent->phone }}
{{ Str::limit($agent->address, 30) }}

{{ ucfirst($agent->vehicle_type) }}
{{ $agent->license_number }}
{{ $agent->assignedOrders->count() }}
Total Orders
{{ $agent->assignedOrders->where('status', 'delivered')->count() }} Delivered
@if($agent->is_active) Active
Available @else Inactive
Unavailable @endif
{{ $agent->created_at->format('M d, Y') }}
{{ $agent->created_at->format('h:i A') }}
@foreach($agent->assignedOrders->take(5) as $order) @endforeach
Tracking Code Route Status Date
{{ $order->tracking_code }} {{ $order->pickupDistrict->name }} → {{ $order->dropDistrict->name }} {{ ucfirst(str_replace('_', ' ', $order->status)) }} {{ $order->created_at->format('M d') }}
@endif
@endforeach
{{ $agents->appends(request()->query())->links() }}
@else

No Agents Found

No agents match your current search criteria.

Add First Agent
@endif @endsection @push('styles') @endpush @push('scripts') @endpush