/**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     SchoolClass::findOrFail($id)->delete();
     return redirect(action('SchoolClassController@index'));
 }
Esempio n. 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param $classId
  * @param $studentId
  *
  * @return Response
  */
 public function disassociate($classId, $studentId)
 {
     $class = SchoolClass::findOrFail($classId);
     $class->students()->detach($studentId);
     return redirect(action('SchoolClassController@show', [$classId]));
 }