39 lines
850 B
PHP
39 lines
850 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Season;
|
|
use App\Models\Show;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ShowController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$shows = Show::paginate(48);
|
|
|
|
return view('show.index', compact('shows'));
|
|
}
|
|
|
|
public function show(string $slug)
|
|
{
|
|
$show = Show::with('posters', 'backdrops', 'externalIds', 'networks', 'genres', 'productionCompanies')->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)
|
|
{
|
|
|
|
}
|
|
|
|
public function episode(string $slug, int $seasonNumber, int $episodeNumber)
|
|
{
|
|
|
|
}
|
|
}
|