->where('events.visible', '=', true)
->orderBy('episodes.start')
->limit(1000);
- if ($request->user() && $request->user()->isAdmin()) {
+ if ($request->user() && $request->user()->isPrivileged()) {
$episodes = $episodes->with('crew');
} else {
$episodes = $episodes->with([
return $this->role === 'admin';
}
+ public function isPrivileged() {
+ return $this->role === 'special' || $this->isAdmin();
+ }
+
public function isApplicant(Tournament $tournament) {
foreach ($tournament->applications as $applicant) {
if ($applicant->user_id == $this->id) {