Skip to content

[7.x] Fix compiled route actions without a namespace#32512

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
riasvdv:fix-compiled-route-namespacing
Apr 23, 2020
Merged

[7.x] Fix compiled route actions without a namespace#32512
taylorotwell merged 1 commit into
laravel:7.xfrom
riasvdv:fix-compiled-route-namespacing

Conversation

@riasvdv

@riasvdv riasvdv commented Apr 23, 2020

Copy link
Copy Markdown
Contributor

Currently when using invokeable controllers in actions, using compiled routes will not work properly.

For example

action(\Spatie\MailcoachSesFeedback\SesWebhookController::class)

Will look in the compiled routes for a controller Spatie\MailcoachSesFeedback\SesWebhookController because of the trim here https://github.com/laravel/framework/blob/7.x/src/Illuminate/Routing/UrlGenerator.php#L480

But inside the compiled routes, the route gets saved as \Spatie\MailcoachSesFeedback\SesWebhookController

So to correctly match the compiled routes against the action we want, we also have to trim that backslash when comparing.

@GrahamCampbell GrahamCampbell changed the title [7.x] Fixes compiled route actions without a namespace [7.x] Fix compiled route actions without a namespace Apr 23, 2020
@taylorotwell taylorotwell merged commit 4e6b788 into laravel:7.x Apr 23, 2020
@riasvdv riasvdv deleted the fix-compiled-route-namespacing branch April 26, 2020 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants