Closed lintangtimur closed 1 year ago
You'll need to pass along relevant arguments when calling ->parent
.
E.g. $trail->parent('video.category', $category);
.
Thank you
for anyone else, this is another way:
Breadcrumbs::for('aspect.show', function (BreadcrumbTrail $trail, Category $category, Article $article) {
$trail->parent('category.show', $category);
$trail->push($article->title, route('article.show', ['article' => $article, 'category' => $category]));
});
and in blade:
{{ Breadcrumbs::render('article.show', $category, $article) }}
i thinks this should be added to the readme , it'll be useful
@ahmadyousefdev Not sure how this relates to the original issue. The behavior of passing multiple params to Breadcrumbs::render
is suggested here, but could be more explicit. PRs to improve documentation are always welcome.
How to make breadcrum from route like this
My expectation
Home > {Dynamic Category Name} > {Dynamic Video title}
My code
Error response
Too few arguments to function Diglactic\Breadcrumbs\ServiceProvider::{closure}(), 1 passed in D:\Code\vendor\diglactic\laravel-breadcrumbs\src\Generator.php on line 64 and exactly 2 expected