public function exitClassroom(ExitClassroomRequest $request) { $input = $request->all(); $student = student(); $student->classrooms()->detach($input['classroom_id']); event(new StudentExitClassroom(Classroom::find($input['classroom_id']), $student, new User())); return redirect()->route('students.profile.classrooms.index'); }
public function exitClassroom(ExitClassroomRequest $request) { $input = $request->all(); $student = student(); $student->classrooms()->detach([$input['classroom_id'] => ['student_id' => $request->input('student_id')]]); event(new StudentExitClassroom(Classroom::find($input['classroom_id']), $student, new User())); return redirect()->route('students.subjects.classrooms', $request->input('student_id')); }