42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
||
/*
|
||
* Copyright (c) 2023.
|
||
*
|
||
* Aidyn Sapargaliyev
|
||
* ТОО Дизайн лаборатория А7
|
||
*
|
||
*/
|
||
|
||
namespace App\Modules\main\Components;
|
||
|
||
use A7kz\Platform\Modules\Platform\Core\Services\Base\Component;
|
||
use Illuminate\Support\Facades\Request;
|
||
use Illuminate\Support\Carbon;
|
||
use Illuminate\Support\Facades\Http;
|
||
|
||
class Main extends Component
|
||
{
|
||
public function __construct(array $params = [], $module = 'Platform.Core')
|
||
{
|
||
parent::__construct($params, $module);
|
||
$this->template = 'pipicar::main.views.main';
|
||
|
||
|
||
|
||
$request = new \Illuminate\Http\Request([
|
||
'started_at' => Carbon::now()->toDateString(),
|
||
'ended_at' => Carbon::now()->addDays(3)->toDateString(),
|
||
]);
|
||
|
||
$response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request);
|
||
$this->params['cars'] = collect($response->getData(true));
|
||
|
||
// $class_filters = Request::input('class_filters') ?? null;
|
||
// $response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [
|
||
// 'started_at' => Carbon::now()->toDateString(),
|
||
// 'ended_at' => Carbon::now()->addDays(3)->toDateString(),
|
||
// ]);
|
||
// $this->params['cars'] = collect($response->json());
|
||
}
|
||
}
|