public function getTrash($id = '') { if ($id == '') { $teachers = Teachers::getTrash(); $msg_success = Session::get('msg_success'); $msg_error = Session::get('msg_error'); return View::make('backend.teachers.trash', array('teachers' => $teachers, 'msg_success' => $msg_success, 'msg_error' => $msg_error)); } else { $teacher = Teachers::find($id); $trash = Teachers::trash($id); if (!$trash) { return Redirect::to($this->route)->with('msg_error', Lang::get('messages.teachers_trash_err', array('firstName' => $teacher->firstName, 'lastName' => $teacher->lastName))); } else { return Redirect::to($this->route)->with('msg_success', Lang::get('messages.teachers_trash', array('firstName' => $teacher->firstName, 'lastName' => $teacher->lastName))); } } }