/** * Update the specified video in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(VideoFormRequest $request, $id) { $video = Video::find($id); $youtube_id = $this->getVideoId($request->input('link')); $video->youtube_id = $youtube_id; $video->title = $request->input('title'); $video->description = $request->input('description'); $video->category_id = (int) $request->input('category'); $video->save(); return redirect('videos/' . $video->id); }
/** * Handle display of a single video * * @param $videoId * @return \Illuminate\View\View */ public function display($videoId) { $video = Video::find($videoId); return view('pages.single-video', compact(['video'])); }