26 lines
738 B
PHP
26 lines
738 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Supervisor;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Supervisor\Concerns\ScopesSupervisorResources;
|
|
use App\Services\DashboardService;
|
|
use Inertia\Inertia;
|
|
use Inertia\Response;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
use ScopesSupervisorResources;
|
|
|
|
public function index(DashboardService $dashboardService): Response
|
|
{
|
|
$supervisor = $this->supervisor();
|
|
|
|
return Inertia::render('Supervisor/Dashboard', [
|
|
'kpis' => $dashboardService->getKpis($supervisor),
|
|
'alerts' => $dashboardService->getAlerts($supervisor),
|
|
'machinesOverview' => $dashboardService->getMachinesOverview($supervisor),
|
|
]);
|
|
}
|
|
}
|