$teacher, 'subject' => $subject, 'grades' => $this->service->getGrades($subject), ]); } public function store(GradeTeacherPostRequest $request, Teacher $teacher, Subject $subject): RedirectResponse { return redirect()->route('teachers.subjects.show', [ $this->service->create($request->validated(), $teacher), $subject, ]); } public function edit(Teacher $teacher, Subject $subject, Grade $grade): View { return view('grade-teacher.edit', [ 'teacher' => $teacher, 'subject' => $subject, 'updateGrade' => $grade, 'grades' => $this->service->getGrades($subject), ]); } public function update(GradeTeacherPostRequest $request, Teacher $teacher, Subject $subject, Grade $grade): RedirectResponse { return redirect()->route('teachers.subjects.show', [ $this->service->update($teacher, $request->validated(), $grade), $subject, ]); } public function destroy(Teacher $teacher, Subject $subject, Grade $grade): RedirectResponse { return redirect()->route('teachers.subjects.show', [ $this->service->delete($teacher, $grade), $subject, ]); } }