tabulationService = $tabulationService; } public function getAcceptanceLimits() { // TODO modifying audition limits should refresh this cache return Cache::remember($this->limitsCacheKey, now()->addDay(), function () { $limits = SeatingLimit::with('ensemble')->get(); // Sort limits by ensemlbe->rank $limits = $limits->sortBy(function ($limit) { return $limit->ensemble->rank; }); return $limits->groupBy('audition_id'); }); } public function getLimitForAudition($auditionId) { return $this->getAcceptanceLimits()[$auditionId]; } public function refershLimits() { Cache::forget($this->limitsCacheKey); } public function getSeatableEntries($auditionId) { $entries = $this->tabulationService->auditionEntries($auditionId); return $entries->reject(function ($entry) { return $entry->hasFlag('declined'); }); } }