validated(); $entranceExamination = new EntranceExamination(); $entranceExamination->examination_type_id = $validated['examination_type_id']; $entranceExamination->direction_id = $validated['direction_id']; $entranceExamination->subject_id = $validated['subject_id']; $entranceExamination->scores = $validated['scores']; $entranceExamination->position = $validated['position']; $entranceExamination->subject_type_id = $validated['subject_type_id']; $entranceExamination->save(); return redirect()->route('entrance_examinations.index'); } public function show(EntranceExamination $entranceExamination): View { return view( 'admin.catalog.direction.entrance_examination.show', compact('entranceExamination') ); } public function edit(EntranceExamination $entranceExamination): View { $directions = Direction::pluck('name', 'id'); $examination_types = ExaminationType::pluck('name', 'id'); $subjects = Subject::pluck('name', 'id'); $subjectTypes = SubjectType::pluck('name', 'id'); return view( 'admin.catalog.direction.entrance_examination.edit', compact( 'entranceExamination', 'directions', 'examination_types', 'subjects', 'subjectTypes', ) ); } public function update(UpdateEntranceExaminationRequest $request, EntranceExamination $entranceExamination): RedirectResponse { $validated = $request->validated(); $entranceExamination->examination_type_id = $validated['examination_type_id']; $entranceExamination->direction_id = $validated['direction_id']; $entranceExamination->subject_id = $validated['subject_id']; $entranceExamination->scores = $validated['scores']; $entranceExamination->position = $validated['position']; $entranceExamination->subject_type_id = $validated['subject_type_id']; $entranceExamination->save(); return redirect()->route('entrance_examinations.index'); } public function destroy(EntranceExamination $entranceExamination): RedirectResponse { $entranceExamination->delete(); return redirect()->route('entrance_examinations.index'); } }