public function edit($id) { $mp4 = MP4::whereId($id)->first(); $cats = Category::orderBy('name')->get(); if (Auth::check()) { $user = Auth::user(); if ($user->id == $mp4->user_id || $user->is_admin()) { $data = ['mp4' => $mp4, 'title' => "Modifye {$mp4->name}", 'cats' => $cats]; return View::make('mp4.put', $data); } else { return Redirect::to('/mp4')->withMessage('Ou pa gen dwa pou w modifye videyo a.'); } } return Redirect::to('/mp4')->with('message', 'Fòk ou konekte w pou w ka aksede ak paj ou vle a.'); }