@extends('layouts.admin') @section('title', 'Clients') @section('page_title', 'Gestion des clients') @section('content') @php $tab = request('tab', 'comptes'); @endphp
Comptes ({{ $clients->count() }}) Contacts devis ({{ $contacts->count() }})
@if($tab === 'comptes')
@if($clients->count())
@foreach($clients as $client) @endforeach
ClientEntrepriseTéléphoneDevisInscrit leDernière connexionStatutActions
{{ strtoupper(substr($client->name, 0, 2)) }}
{{ $client->name }}
{{ $client->email }}
{{ $client->company ?? '—' }} {{ $client->phone ?? '—' }} {{ $client->quotes_count }} devis {{ \Carbon\Carbon::parse($client->created_at)->format('d/m/Y') }} {{ $client->last_login_at ? \Carbon\Carbon::parse($client->last_login_at)->diffForHumans() : 'Jamais' }} {{ $client->is_active ? 'Actif' : 'Inactif' }}
@csrf
@csrf @method('DELETE')
@else

Aucun compte client

@endif
@endif @if($tab === 'contacts')
@if($contacts->count())
@foreach($contacts as $c) @endforeach
NomEntrepriseEmailTéléphonePremier contactCompte
{{ strtoupper(substr($c->name, 0, 2)) }}
{{ $c->name }}
{{ $c->company ?? '—' }} {{ $c->email }} {{ $c->phone ?? '—' }} {{ \Carbon\Carbon::parse($c->created_at)->format('d/m/Y') }} @if($clients->where('email', $c->email)->count()) A un compte @else Sans compte @endif
@else

Aucun contact

@endif
@endif @endsection