Merge branch 'breadcrumb' into 'develop'
fix: 🐛 add a condition for nullable models when laravel does not resolve them
See merge request ldc-web/projets/nature-and-respect!70
This commit is contained in:
commit
b32f19fdb9
1 changed files with 4 additions and 2 deletions
|
|
@ -90,9 +90,11 @@ Breadcrumbs::for(
|
|||
);
|
||||
Breadcrumbs::for(
|
||||
sprintf('%s.news.show', app()->currentLocale()),
|
||||
function (Generator $trail, News $publishedNews) {
|
||||
function (Generator $trail, News|null $publishedNews = null) {
|
||||
$trail->parent(sprintf('%s.home', app()->currentLocale()));
|
||||
$trail->push($publishedNews->title, route('news.show', $publishedNews));
|
||||
if (!is_null($publishedNews)) {
|
||||
$trail->push($publishedNews->title, route('news.show', $publishedNews));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue