public function destroy($id)
 {
     try {
         $oldStudent = Student::findOrFail($id);
     } catch (Exception $e) {
         App::abort(404);
     }
     //Display flash msg on successful deletion
     if (Student::destroy($id)) {
         Session::flash('message', "Student '" . $oldStudent->name . "' deleted successfully. ");
         return redirect()->route('students.index');
     } else {
         Session::flash('message', "Deleting student unsuccessful.");
         return redirect()->route('students.index');
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Student::destroy($id);
     return redirect()->route('student.index');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  Student  $student
  * @return Response
  */
 public function destroy(Student $student)
 {
     $this->authorize('manage', new Student());
     Student::destroy($id);
     return redirect('student');
 }
Beispiel #4
0
 public function destroy($id)
 {
     return Student::destroy($id);
 }
 /**
  * Remove a student
  *
  * @param $rollNo
  * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
  */
 public function removeStudent($rollNo)
 {
     if ($rollNo != null) {
         Student::destroy($rollNo);
     }
     return redirect('admins/manage/students');
 }
Beispiel #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Student::destroy($id);
     return Redirect::route('student.show');
 }