Files
2026-10-07 16:34:12 +02:00

41 lines
933 B
PHP

@extends('layouts.app')
@section('content')
<h2>Liste des clients</h2>
<a href="{{ route('clients.create') }}">
Ajouter un client
</a> <form method="GET" action="{{ route('clients.index') }}">
<input
type="text"
name="search"
placeholder="Rechercher un client"
value="{{ $search }}"
>
<button type="submit">
Rechercher
</button>
</form>
<p>Nombre de clients : {{$clients->count()}}</p>
@foreach($clients as $client)
<p>
{{ $client->name }}
-
{{ $client->email }}
-
{{ $client->city }} <a href="{{ route('clients.show', $client) }}">
Voir
</a>
| <a href="{{ route('clients.edit', $client) }}">Modifier</a>
| <form method="POST"
action="{{ route('clients.destroy', $client) }}">
@csrf
@method('DELETE')
<button type="submit">
Supprimer
</button>
</form>
<p>Client créé le : {{$client->created_at}}</p>
</p>
@endforeach
{{ $clients->links() }}
@endsection