@extends('layouts.dashboard') @section('title', 'Client Management') @section('content')

Client Management

Manage your company clients and their information

Total Clients

{{ $clients->total() }}

Active Clients

{{ \App\Models\Client::where('status', 'active')->count() }}

With GPS Data

{{ \App\Models\Client::whereNotNull('latitude')->whereNotNull('longitude')->count() }}

Total Visits

{{ \App\Models\Visit::count() }}

@if($clients->count() > 0)
@foreach($clients as $client) @endforeach
CLIENT
LOCATION
CONTACT
VISITS
STATUS
ACTIONS
{{ $client->name }}
{{ $client->contact_person ?? 'No contact person' }}
{{ $client->email ?? 'No email' }}
{{ $client->area }}, {{ $client->city->name }}
{{ $client->governorate->name }}
@if($client->latitude && $client->longitude) GPS Enabled @endif
{{ $client->phone }}
{{ $client->address ?? 'No address' }}
{{ $client->visits->count() }} visits
Last: {{ $client->visits->first() ? $client->visits->first()->created_at->diffForHumans() : 'No visits' }}
{{ ucfirst($client->status) }}
@csrf @method('DELETE')
@if($clients->hasPages())
{{ $clients->links() }}
@endif @else

No Clients Found

Get started by adding your first client.

Add Client
@endif
@endsection