sortBy('position'); return view('menu.reception-screen', compact('admissions')); } public function directions() { // $directions = DB::table('faculties') // ->join('departments', 'faculties.id', '=', 'departments.faculty_id') // ->join('directions', 'departments.id', '=', 'directions.department_id') // ->select('faculties.name as faculties.name', 'directions.name', 'directions.id') // ->groupBy('faculties.name') // ->get(); $faculties = Faculty::all(); $subjects = Subject::pluck('name', 'id'); // $infBez = $faculties->find(FacultyEnum::InfBez->value); // $query = `select faculties.name, directions.name, directions.id //FROM faculties //join departments on faculties.id = departments.faculty_id //join directions on departments.id = directions.department_id`; // $directions = DB::($query); // foreach ($faculties as $faculty) { // foreach ($faculty->departments as $department) { // foreach ($department->directions as $direction) { // // } // } // // } return view('new-design.bakalavr-special', compact('faculties', 'subjects')); } public function calculator($request) { return response()->json($request); } }