39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Bo;
|
|
|
|
use App\Contracts\Executor;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Bo\Dashboard\DashboardRequest;
|
|
use App\Queries\Dashboard\GetBoDashboardQuery;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly Executor $executor,
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Dashboard Page
|
|
*/
|
|
public function index(DashboardRequest $request, GetBoDashboardQuery $query): View
|
|
{
|
|
$output = $this->executor->execute(
|
|
$query,
|
|
$request->toGetBoDashboardQueryInput(),
|
|
);
|
|
|
|
return view('bo.dashboard', [
|
|
'prevDates' => $output->prevDates,
|
|
'statsShop' => $output->statsShop,
|
|
'statsCustomer' => $output->statsCustomer,
|
|
'adhesion' => $output->adhesion,
|
|
'employeeCount' => $output->employeeCount,
|
|
'customersLinkedToEmployeeCount' => $output->customersLinkedToEmployeeCount,
|
|
]);
|
|
}
|
|
}
|