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