33 lines
901 B
PHP
33 lines
901 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\AuditionCacheService;
|
|
use App\Services\SeatingService;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ResultsPage extends Controller
|
|
{
|
|
protected $auditionCacheService;
|
|
protected $seatingService;
|
|
public function __construct(AuditionCacheService $auditionCacheService, SeatingService $seatingService)
|
|
{
|
|
$this->auditionCacheService = $auditionCacheService;
|
|
$this->seatingService = $seatingService;
|
|
}
|
|
|
|
/**
|
|
* Handle the incoming request.
|
|
*/
|
|
public function __invoke(Request $request)
|
|
{
|
|
$publishedAuditions = $this->auditionCacheService->getPublishedAuditions();
|
|
|
|
foreach ($publishedAuditions as $audition) {
|
|
$audition->seats = $this->seatingService->getSeatsForAudition($audition->id);
|
|
}
|
|
|
|
return view('results.index', compact('publishedAuditions'));
|
|
}
|
|
}
|