validated(); $educationalInstitution = new EducationalInstitution(); $educationalInstitution->name = $validated['name']; $educationalInstitution->description = $validated['description']; $educationalInstitution->position = $validated['position']; $educationalInstitution->save(); return redirect()->route('educational-institutions.index'); } public function show(EducationalInstitution $educationalInstitution) { return view('educational-institution.show', compact('educationalInstitution')); } public function edit(EducationalInstitution $educationalInstitution) { return view('educational-institution.edit', compact('educationalInstitution')); } public function update(UpdateEducationalInstitutionRequest $request, EducationalInstitution $educationalInstitution) { $validated = $request->validated(); $educationalInstitution->name = $validated['name']; $educationalInstitution->description = $validated['description']; $educationalInstitution->position = $validated['position']; $educationalInstitution->save(); return redirect()->route('educational-institutions.index'); } public function destroy(EducationalInstitution $educationalInstitution) { $educationalInstitution->delete(); return redirect()->route('educational-institutions.index'); } }