@extends('layouts.admin') @section('title', 'Agents immobiliers') @section('page-title', 'Agents immobiliers') @section('page-subtitle', 'Professionnels (agents & agences)') @section('content')

{{ $agents->total() }} agent(s) au total

@include('partials.admin.page-actions', ['createRoute' => route('admin.agents.create'), 'createLabel' => 'Nouvel agent'])
@forelse ($agents as $agent) @php $statusClasses = match ($agent->status?->value) { 'approved' => 'bg-emerald-50 text-emerald-700', 'pending' => 'bg-amber-50 text-amber-700', 'rejected' => 'bg-red-50 text-red-700', 'suspended' => 'bg-slate-100 text-slate-600', default => 'bg-slate-100 text-slate-600', }; $statusLabels = ['approved' => 'Validé', 'pending' => 'En attente', 'rejected' => 'Refusé', 'suspended' => 'Suspendu']; $typeLabels = ['independent_agent' => 'Agent', 'agency' => 'Agence']; @endphp @empty @endforelse
Nom E-mail Téléphone Type Inscription Statut Actions
{{ $agent->name }} {{ $agent->email }} {{ $agent->phone ?? '—' }} {{ $typeLabels[$agent->account_type?->value] ?? '—' }} {{ $agent->created_at?->format('d/m/Y') ?? '—' }} {{ $statusLabels[$agent->status?->value] ?? '—' }} @if ($agent->status?->value !== 'approved')
@csrf @method('PATCH')
· @endif @if ($agent->status?->value !== 'suspended')
@csrf @method('PATCH')
· @endif Modifier ·
@csrf @method('DELETE')
@if ($search !== '' || $status !== '') Aucun agent ne correspond aux filtres. @else Aucun agent inscrit. @endif
@if ($agents->hasPages())
{{ $agents->links() }}
@endif @endsection