fix bugs in BreadcrumbService and Person page
This commit is contained in:
@@ -19,14 +19,19 @@ class BreadcrumbService
|
||||
// Пытаемся найти index-версию маршрута
|
||||
$indexRouteName = $this->getIndexRouteName($routeName);
|
||||
|
||||
|
||||
if ($indexRouteName === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// Используем index-версию, если она существует
|
||||
$finalRouteName = Route::has($indexRouteName) ? $indexRouteName : $routeName;
|
||||
|
||||
// Используем index-версию, если она существует
|
||||
$finalRouteName = Route::has($indexRouteName) ? $indexRouteName : null;
|
||||
|
||||
if ($finalRouteName === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$path = $this->generatePath($finalRouteName);
|
||||
@@ -72,6 +77,7 @@ class BreadcrumbService
|
||||
|
||||
// Заменяем последнюю часть на index
|
||||
$parts[count($parts) - 1] = 'index';
|
||||
|
||||
return implode('.', $parts);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class SeoPageProvider
|
||||
fn() => Page::where('path', $path)->first()
|
||||
);
|
||||
|
||||
return $page->seo?->toArray(); // Предполагается, что у модели Page есть поле `seo` (JSON или массив)
|
||||
return $page->seo?->toArray();
|
||||
}
|
||||
|
||||
private function getCurrentPath(): string
|
||||
|
||||
Reference in New Issue
Block a user