DashboardController.php 387 B

1234567891011121314151617
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Services\DashboardService;
  4. use Illuminate\Http\JsonResponse;
  5. class DashboardController extends Controller
  6. {
  7. public function __construct(protected DashboardService $service) {}
  8. public function stats(): JsonResponse
  9. {
  10. $stats = $this->service->getStats();
  11. return $this->successResponse(payload: $stats);
  12. }
  13. }