Example #1
0
 public function getDelete($id = '')
 {
     if ($id == '') {
         return Redirect::to($this->route)->with('msg_error', Lang::get('messages.teachers_display_err'));
     } else {
         $teacher = Teachers::find($id);
         $delete = Teachers::destroy($id);
         if (!$delete) {
             return Redirect::to($this->route . '/trash')->with('msg_error', Lang::get('messages.teachers_delete_err', array('firstName' => $teacher->firstName, 'lastName' => $teacher->lastName)));
         } else {
             return Redirect::to($this->route . '/trash')->with('msg_success', Lang::get('messages.teachers_delete', array('firstName' => $teacher->firstName, 'lastName' => $teacher->lastName)));
         }
     }
 }