dstpabuaran.com/app/Http/Controllers/DashboardController.php
Yoga Pangestu 2bb814702a feat: add ChartContainer and related components for enhanced charting capabilities in the dashboard
- Introduced ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, and ChartLegendContent components to streamline chart rendering and tooltip management.
- Replaced existing donut chart implementation with a new pie chart component utilizing the new charting system.
- Updated dashboard to utilize the new chart components, improving maintainability and visual consistency.
- Refactored chart data handling and configuration for better integration with the new charting components.
2026-08-09 12:52:12 +07:00

31 lines
902 B
PHP

<?php
namespace App\Http\Controllers;
use App\Services\DashboardService;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class DashboardController extends Controller
{
public function __construct(
private DashboardService $service
) {}
public function __invoke(Request $request): Response
{
$user = $request->user();
return Inertia::render('dashboard', [
'attendance' => $this->service->getAttendanceStats(),
'revenueSummary' => $this->service->getRevenueSummary(),
'expenseSummary' => $this->service->getExpenseSummary(),
'orderStats' => $this->service->getOrderStats(),
'todayAttendance' => $this->service->getTodayAttendance($user),
'isOnLeave' => $this->service->isOnLeave($user),
'canCheckIn' => $user->employee !== null,
]);
}
}