From 59c0fdce3d4efb516fa4f8a61ca58726f64756fb Mon Sep 17 00:00:00 2001 From: nimtaurel Date: Tue, 20 May 2025 16:46:10 +0500 Subject: [PATCH] nim_style 11 --- modules/main/Components/Main.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/main/Components/Main.php b/modules/main/Components/Main.php index a09a7f7..7ddc931 100644 --- a/modules/main/Components/Main.php +++ b/modules/main/Components/Main.php @@ -26,28 +26,28 @@ class Main extends Component $ended_at = Request::input('ended_at') ?? null; $bodywork_filters = Request::input('bodywork_filters') ?? null; -// $request = new \Illuminate\Http\Request([ -// 'started_at' => $started_at ?? Carbon::now()->toDateString(), -// 'ended_at' => $ended_at ?? Carbon::now()->addDays(3)->toDateString(), -// 'class' => $class_filters ?? null, -// 'bodywork' => $bodywork_filters ?? null, -// ]); -// -// $response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request); -// -// $this->params['cars'] = collect($response->getData(true))->filter(function ($item) { -// return !empty($item['tariffs']); -// })->values(); - - $response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [ + $request = new \Illuminate\Http\Request([ 'started_at' => $started_at ?? Carbon::now()->toDateString(), 'ended_at' => $ended_at ?? Carbon::now()->addDays(3)->toDateString(), 'class' => $class_filters ?? null, 'bodywork' => $bodywork_filters ?? null, ]); - $this->params['cars'] = collect($response->json())->filter(function ($item) { + $response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request); + + $this->params['cars'] = collect($response->getData(true))->filter(function ($item) { return !empty($item['tariffs']); })->values(); + +// $response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [ +// 'started_at' => $started_at ?? Carbon::now()->toDateString(), +// 'ended_at' => $ended_at ?? Carbon::now()->addDays(3)->toDateString(), +// 'class' => $class_filters ?? null, +// 'bodywork' => $bodywork_filters ?? null, +// ]); +// +// $this->params['cars'] = collect($response->json())->filter(function ($item) { +// return !empty($item['tariffs']); +// })->values(); } }