Esempio n. 1
0
 public function actionDelete($id)
 {
     $user = Auth::user();
     $writer = Writer::where('user_id', '=', $user->id)->findOrFail($id);
     $writer->delete($writer);
     \Session::flash('flash_message', 'You have successfully deleted a writer.');
     return redirect('writers');
 }
Esempio n. 2
0
 public function viewUpdate($id)
 {
     $user = Auth::user();
     $movie = Movie::where('user_id', '=', $user->id)->findOrFail($id);
     $genres = Genre::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     $ratings = Rating::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     $directors = Director::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     $writers = Writer::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     $casts = Cast::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     $labels = Label::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get();
     return view('movies.viewUpdate')->with('movie', $movie)->with('genres', $genres)->with('ratings', $ratings)->with('directors', $directors)->with('writers', $writers)->with('casts', $casts)->with('labels', $labels);
 }