Skip to content

Fix issue with route scope binding when getRouteKeyName method is different from Route scoped#972

Open
Joemires wants to merge 4 commits into
knuckleswtf:v5from
Joemires:v5
Open

Fix issue with route scope binding when getRouteKeyName method is different from Route scoped#972
Joemires wants to merge 4 commits into
knuckleswtf:v5from
Joemires:v5

Conversation

@Joemires

Copy link
Copy Markdown

There's a problem when you are using

Route::apiResource('products', Controllers\Store\ProductController::class)->scoped(['product' => 'slug'])

The documentation still uses your getRouteKeyName model method and this is a great problem for people with special routes having their special scopes

@shalvah

shalvah commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

I probably only know about 30% of Laravel features at this point. 😅

@shalvah

shalvah commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

Please fix the tests + add a new one for this use case, if possible.

@shalvah

shalvah commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

Tests fixed (wasn't your fault), but can you add a test for this too?

@Joemires

Copy link
Copy Markdown
Author

Hey @shalvah
Sorry I was busy with things

I'll look into this and revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants