-
Notifications
You must be signed in to change notification settings - Fork 415
Let Breadcrumbs auto guess breadcrumb name #24
Conversation
Do not require breadcrumb name in `render()` method, guess it by the current route name instead.
I like the idea, but I think it should be passed the route parameters too so you can use it on all pages. Do you know if that is possible? Thanks |
I am afraid, I do not understand. |
So in your example of user/edit/1 it should get 1 as the second parameter. Or if model binding is used it should get the user 1 model object. |
Yeah, I get it... So we should find out the way how to pass |
Okay, got it... Breadcrumbs::register('test', function($breadcrumbs, $productId, $colorId){
// $product = Product::find($productId);
// $color = Product::find($colorId);
});
Route::get('product/{productId}/color/{colorId}', ['as' => 'test', 'uses' => function(){
return Breadcrumbs::render();
}]); |
Looks good. I will test it over the weekend and try to get a new version released. |
Sweet. Works like a charm here ;) |
Let Breadcrumbs auto guess breadcrumb name
Great, thanks! Now I can finally pull your package into my project! :) |
Released in 2.2.0. |
No description provided.