getFilteredEducationalGroupsTask->run($filters); $schedulesPaginate = $educationalGroups->toArray(); unset($schedulesPaginate['data']); $educationalGroups = EducationalGroupResource::collection($educationalGroups->items()); $schedulesByFaculty = $educationalGroups->groupBy(function ($group) { return $group->faculty->title; }); $schedulesByFaculty = $schedulesByFaculty->toArray(); $forms_education = $this->getAllFormsEducationTask->run(); $faculties = $this->getAllActiveFacultiesTask->run(); $filtersData = $this->buildScheduleFiltersTask->run($filters); $seo = $this->seoPageProvider->getSeoForCurrentPage(); return [ 'filters' => $filtersData, 'forms_education' => $forms_education, 'schedulesByFaculty' => inertia()->deepMerge(fn() => $schedulesByFaculty), 'schedules_paginator' => $schedulesPaginate, 'seo' => $seo, 'faculties' => $faculties, ]; } }