Example #1
0
 /**
  *
  */
 public function getDoDelete($id)
 {
     $verb = \App\Verb::find($id);
     if (is_null($verb)) {
         \Session::flash('flash_message', 'Verb not found.');
         return redirect('/verbs/query');
     }
     // instead of this, edit the migrations to include "on delete cascade"
     // if($book->tags()) {
     //     $book->tags()->detach();
     // }
     $verb->delete();
     \Session::flash('flash_message', $verb->infinitive_it . ' was deleted.');
     return redirect('/verbs/query');
 }