where('slug', $slug)->first(); $comments = []; $seasons = Season::where('show_id', $show->id)->orderBy('season_number', 'ASC')->get(); return view('show.show', compact('show', 'comments', 'seasons')); } public function season(string $slug, int $seasonNumber) { $show = Show::with('posters', 'backdrops', 'externalIds', 'networks', 'genres', 'productionCompanies')->where('slug', $slug)->first(); if (!$show) { abort(404); } $seasons = Season::where('show_id', $show->id)->orderBy('season_number', 'ASC')->get(); $currentSeason = Season::where('show_id', $show->id)->where('season_number', $seasonNumber)->first(); if (!$currentSeason) { abort(404); } $episodes = \App\Models\Episode::where('show_id', $show->id) ->where('season_id', $currentSeason->id) ->orderBy('episode_number', 'ASC') ->get(); $comments = []; return view('show.season', compact('show', 'seasons', 'currentSeason', 'episodes', 'comments')); } public function episode(string $slug, int $seasonNumber, int $episodeNumber) { } }