You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I have a resource route that has a dash in the name, route/model binding gets broken and an error "Missing required parameter for [Route....]"
What version does this affect?
Laravel Version: 9.38
Package Version: 1.6.0
To Reproduce
Setup a simple Resource Controller using Resource Breadcrumbs. Ex:
Route::resource('some-route', SomeRouteController::class)->breadcrumbs(function(ResourceBreadcrumbs $breadcrumbs) {
$breadcrumbs->index('Index Rte')->show('Show Rte')->edit('Edit Rte');
}
When trying to visit the Edit or Show routes and you will get the missing required parameter error.
Changing the - to an underscore will correct the error. Separating the resource route into individual routes will also correct the error.
Expected behavior
I use dashes in my route names on a regular basis as they are easy to read and match up with Laravel's slug method
The text was updated successfully, but these errors were encountered:
I have the same problem. I also found out that Gretel is converting the kebab case resource identifier ("some-route") to snake case in the model identifier variable ($some_route) instead of camel case ($someRoute). That should be fixed as well.
In the test you provided, you are using Route Model Binding. In my examples I am not. In my use case, I use it where I can, but in this case I search for the model based on if the user input a slug (string) or the ID (int) of the model. I need to search two columns so Route Model Binding does not work well for me.
Describe the bug
When I have a resource route that has a dash in the name, route/model binding gets broken and an error "Missing required parameter for [Route....]"
What version does this affect?
To Reproduce
Setup a simple Resource Controller using Resource Breadcrumbs. Ex:
Route::resource('some-route', SomeRouteController::class)->breadcrumbs(function(ResourceBreadcrumbs $breadcrumbs) {
$breadcrumbs->index('Index Rte')->show('Show Rte')->edit('Edit Rte');
}
When trying to visit the Edit or Show routes and you will get the missing required parameter error.
Changing the - to an underscore will correct the error. Separating the resource route into individual routes will also correct the error.
Expected behavior
I use dashes in my route names on a regular basis as they are easy to read and match up with Laravel's slug method
The text was updated successfully, but these errors were encountered: