-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.1] Added ability to reference actions via an array #11300
Conversation
|
||
list($class, $method) = each($action); | ||
|
||
if (! class_exists($class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return class_exists($class);
return false; | ||
} | ||
|
||
list($class, $method) = each($action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be replaced by $class = $action[0];
since $method
is not used afterwards.
@GrahamCampbell Should I fix the SC error or isn't it that strict? |
Looks like a good idea, so we use the Should it be |
Although that would conflict with actual (array) callbacks, that people could be using already. |
👎
If you desperately want this ctrl clicking on your routes there is an excelent phpstorm Laravel plugin providing that |
The backslash is unneeded and should be avoided. |
If you don't want a namespace prefix, then set it to nothing in your route service provider. |
This is now merged in: #24385 |
Actual action method is merged in: #24738 |
This pr adds the ability to reference actions via an array as followed:
instead of
This is way cleaner and obvious in my opinion.
Also works in the routes.php