45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
use App\Models\Client;
|
|
class ClientsController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
{
|
|
// $clients = Client::all();
|
|
|
|
// 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]);
|
|
}
|
|
} |