input()['predmets']; $getsSubjects = json_decode($getJSON); $countUserSubjects = count($getsSubjects); $filteredDirectionIds = EntranceExamination::all() ->select("direction_id", "subject_id") ->groupBy('direction_id') ->map(function ($direction) { return $direction->map(fn($item) => $item['subject_id']); }) ->filter(fn($direction) => count($direction) <= $countUserSubjects)->keys(); $directions = Direction::whereIn('id', $filteredDirectionIds)->get(); $generateHtml = function ($acc, $direction) { $department = Department::find($direction->department_id); $faculty = Faculty::find($department->faculty_id); // phpcs:disable $fon_3 = URL::to('img/front-page/bakalavr-special/fon3_blok.png'); return "{$acc} {$faculty->name} id}{$direction->id }\" aria-controls=\"offcanvasScrolling\" role=\"button\">{$direction->name}
id }{$direction->id}\" aria-labelledby=\"offcanvasScrollingLabel-{$direction->id}{$direction->id}\" style=\"height: 100%; font-family: Geologica-Medium; overflow-y: auto ; background-image: url({$fon_3}); color: #004329\">
{$direction->code}
{$direction->name}

{$direction->description}

Уровень образования: {$direction->educationLevel->name}


Форма обучения: {$direction->educationForm->name}


Бюджетные места: {$direction->budget_places}


Квота: {$direction->quota}


Места на контракт: {$direction->paid_places}


Стоимость платного обучения: {$direction->cost_paid_place}


Период обучения (в годах): {$direction->period}
{$direction->period} "; }; // phpcs:enable $html = $directions->reduce($generateHtml, ''); return response()->json(['html' => $html]); } }