sortBy('position'); // return view('menu.reception-screen', compact('admissions')); // } public function directions() { $faculties = Faculty::all(); $subjects = EntranceExamination::all() ->select('subject_id', 'subject_type_id', 'examination_type_id') ->where('examination_type_id', '=', ExaminationTypeEnum::Ege->value) ->reduce(function (?array $carry, $subject) { $id = $subject['subject_id']; $value = Subject::find($id)->name; $carry[$id] = $value; return $carry; }); $directionsWithInstitution = Direction::with(['department']) ->join('departments', 'directions.department_id', '=', 'departments.id') ->join('faculties', 'departments.faculty_id', '=', 'faculties.id') ->join( 'educational_institutions', 'faculties.educational_institution_id', '=', 'educational_institutions.id' ) ->get([ 'directions.id', 'directions.name', "educational_institutions.name as educational_institution_name" ]); return view('new-design.bakalavr-special', compact('faculties', 'subjects', 'directionsWithInstitution')); } public function calculator($request) { return response()->json($request); } }