use App\Models\Title; use App\Models\WatchProgress; public function watch(Title $title) { $source = $title->videoSource; $progress = WatchProgress::where('user_id',auth()->id()) ->where('title_id',$title->id) ->first(); return view('watch',[ 'title'=>$title, 'hls'=>asset($source->hls_url), 'progressPayload'=>[ 'title_id'=>$title->id, 'episode_id'=>null, 'position_seconds'=>$progress->position_seconds ?? 0 ] ]); public function movie(Movie $movie) { $movie->load('videos'); return view('watch.movie', compact('movie')); } }