lms/app/Http/Controllers/DashboardController.php
2025-12-15 12:26:23 +01:00

25 lines
548 B
PHP

<?php
namespace App\Http\Controllers;
use App\Services\DashboardService;
use Illuminate\Support\Facades\Auth;
use Inertia\Inertia;
use Carbon\Carbon;
class DashboardController extends Controller
{
public function __construct(
protected DashboardService $dashboardService,
) {}
public function index()
{
$user = Auth::user();
$currentYear = Carbon::now()->year;
$data = $this->dashboardService->getDashboard($user, $currentYear);
return Inertia::render('dashboard/index', $data);
}
}