some progress

This commit is contained in:
2025-09-06 14:41:10 +03:00
parent d709de39dc
commit 7e0e330ef6
20 changed files with 1051 additions and 485 deletions
+20
View File
@@ -28,7 +28,27 @@ class ShowController extends Controller
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)