From 5b7403cbbc5124774816437bbf42d5817e35db1e Mon Sep 17 00:00:00 2001 From: OMGiTzPomPom Date: Fri, 3 Mar 2023 17:45:53 +0100 Subject: [PATCH] todo controller find --- app/Http/Controllers/ClientsController.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ClientsController.php b/app/Http/Controllers/ClientsController.php index 4b19301..7d0623b 100644 --- a/app/Http/Controllers/ClientsController.php +++ b/app/Http/Controllers/ClientsController.php @@ -13,7 +13,6 @@ class ClientsController extends Controller { return Clients::all(); //return response()->json(['Clients' => Clients::all(), 'status' => 'OK'], 200); - } /** @@ -35,7 +34,16 @@ class ClientsController extends Controller */ public function show($id) { - // + //return Clients::where('id', $id)->get(); + $r = Clients::find($id); + foreach ($r->LignesCommandes as $c) { + foreach ($c->LignesCommandes as $lc) { + $lc->Produits; + } + } + + return $r; + } /**