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!
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.What am I doing wrong?
Thanks!