getIndexRouteNameTask->run($routeName); $finalRouteName = Route::has($indexRouteName) ? $indexRouteName : $routeName; $path = $this->generatePathTask->run($finalRouteName); if ($path === null) { return null; } $page = $this->findPageByPathTask->run($path); if (!$page?->section) { return null; } return [ 'mainSection' => new ClientBreadcrumbSection($page->section->mainSection), 'subSection' => new ClientBreadcrumbSubSection($page->section), 'page' => new ClientBreadcrumbPage($page), ]; } }