store/app/Http/Controllers/Admin/DashboardController.php

32 lines
1.0 KiB
PHP

<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Services\System\DashboardService;
use Inertia\Inertia;
use Inertia\Response;
class DashboardController extends Controller
{
public function __construct(
private readonly DashboardService $dashboardService,
) {}
public function index(): Response
{
return Inertia::render('admin/Dashboard', [
'attendance' => $this->dashboardService->getAttendance(),
'cashOverview' => $this->dashboardService->getCashOverview(),
'revenueSummary' => $this->dashboardService->getRevenueSummary(),
'expenseSummary' => $this->dashboardService->getExpenseSummary(),
'topSuppliers' => $this->dashboardService->getTopSuppliers(),
'topCustomers' => $this->dashboardService->getTopCustomers(),
'topProducts' => $this->dashboardService->getTopProducts(),
'orderStats' => $this->dashboardService->getOrderStats(),
]);
}
}