fix bugs in BreadcrumbService and Person page

This commit is contained in:
F4ilji
2025-04-04 15:11:34 +05:00
parent 13c45b80d2
commit b6fb523aaa
5 changed files with 15 additions and 13 deletions
@@ -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);
}
}
+1 -1
View File
@@ -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