Does this package support route group binding?
Hi! First at all, thank you for this great package!
I have a question: I've tried to get a route group param binding in breadcrumb, but I can't.
This code below results an error:
Illuminate\Routing\RouteFileRegistrar::{closure}(): Argument #2 ($benefit) must be of type App\Models\DRH\Benefit, string given.
Route::group([
'prefix' => 'beneficios',
'as' => 'benefits.',
'middleware' => ['auth'],
], function () {
Route::group([
'prefix' => '{benefit:slug}/reembolsos',
'as' => 'reimbursements.'
], function () {
Route::get('/', ListAll::class)
->name('index')
->breadcrumbs(
fn (\Tabuna\Breadcrumbs\Trail $trail) => $trail->push('Benefícios', route('benefits.index'))
);
///////////// ERROR HAPPENS IN THE ROUTE BELLOW: \\\\\\\\\\\\\\\\\\\\\\
Route::get('solicitar', Create::class)
->name('create')
->breadcrumbs(
fn (\Tabuna\Breadcrumbs\Trail $trail, \App\Models\DRH\Benefit $benefit) => $trail->parent('benefits.reimbursements.index')
->push("Solicitar reembolso para {$benefit->name}")
);
});
// ... other routes
});
What am I doing wrong?
Thanks!
Hey! 👋 I'll try to check the reproduction of the issue over the weekend. However, the model should be passed into the closure if it's available in the route arguments.
A quick guess: maybe it's still not working if you replace the model {benefit:slug} with {benefit}?
Hey! 👋 I'll try to check the reproduction of the issue over the weekend. However, the model should be passed into the closure if it's available in the route arguments.
A quick guess: maybe it's still not working if you replace the model
{benefit:slug}with{benefit}?
Hey, thanks for the answer.
Yes, I've tried to replace {benefit:slug} with {benefit} and no success
Hey! I tried specifying the group, prefix, and other parameters, but I couldn’t reproduce the issue. Maybe I’m missing something. Could you provide a minimal reproducible example? That would really help in figuring this out. 😊