update bread crumb

This commit is contained in:
Edward Yang 2022-07-26 18:18:57 +08:00
parent 891e1db59d
commit 8025bb9160
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,8 @@ Breadcrumbs::for('product', function (BreadcrumbTrail $trail, $product) {
$category = $productModel->categories->first();
if ($category) {
$trail->parent('category', $category);
} else {
$trail->parent('home');
}
$trail->push($product['name'], shop_route('products.show', $productModel));
});