DashboardController.php 558 B

123456789101112131415161718192021222324
  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. public function partnerStats(): JsonResponse
  14. {
  15. $stats = $this->service->getPartnerStats();
  16. return $this->successResponse(payload: $stats);
  17. }
  18. }