Skip to content

fix: use __invoke to inject request classes on invokable controller#118

Open
chuckadams wants to merge 1 commit intobeacon-hq:mainfrom
chuckadams:fix_invokable_controllers
Open

fix: use __invoke to inject request classes on invokable controller#118
chuckadams wants to merge 1 commit intobeacon-hq:mainfrom
chuckadams:fix_invokable_controllers

Conversation

@chuckadams
Copy link

When using a single-action controller with an __invoke method, $route->getActionMethod() will return the name of the controller instead of any usable method, so we end up getting baffling errors about methods like App\Http\Controllers\My\Controller::App\Http\Controllers\My\Controller() not existing. Arguably this is a bug in Laravel, but we have to work around it, so this detects if the method is identical to the controller, and switches it to __invoke if so.

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.

1 participant