Files

26 lines
630 B
PHP
Raw Permalink Normal View History

2025-12-01 06:41:22 +07:00
<?php
namespace App\Http\Controllers;
use App\Services\Dashboard\DashboardService;
use Illuminate\View\View;
2025-12-01 06:41:22 +07:00
class DashboardsController extends Controller
{
public function __construct(private readonly DashboardService $dashboard)
2025-12-01 06:41:22 +07:00
{
}
public function index(): View
{
$user = auth()->user();
$data = $this->dashboard->build($user);
// Backward compatible variable names (dipakai view lama).
$data['movementCount'] = $data['movementCount30'] ?? 0;
$data['disposalCount'] = $data['activeDisposals'] ?? 0;
return view('pages.dashboards.index', $data);
2025-12-01 06:41:22 +07:00
}
}