Files

45 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2026-09-16 11:43:27 +02:00
<?php
namespace App\Http\Controllers;
2026-09-16 12:08:49 +02:00
use App\Models\Client;
2026-09-16 11:43:27 +02:00
class ClientsController extends Controller
{
public function index()
{
2026-09-16 12:08:49 +02:00
{
// $clients = Client::all();
2026-09-16 11:43:27 +02:00
2026-09-16 12:08:49 +02:00
// return view('clients.index', [
// 'clients' => $clients
// ]);
// }
// $clients = Client::where('city', 'Paris')->get();
// $clients = Client::where('name', 'like', '%Martin%')->get();
$clients = Client::find(1);
return view('clients.index', [
'clients' => $clients
]);
}
// $clients = [
// [
// 'name' => 'Jean Dupont',
// 'email' => 'jean@example.com',
// 'city' => 'Paris'
// ],
// [
// 'name' => 'Marie Martin',
// 'email' => 'marie@example.com',
// 'city' => 'Lyon'
// ],
// [
// 'name' => 'Paul Durand',
// 'email' => 'paul@example.com',
// 'city' => 'Marseille'
// ]
// ];
// return view('clients', ['clients' => $clients]);
2026-09-16 11:43:27 +02:00
}
}