Skip to content
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.7] Tuple notation for UrlGenerator actions #24738

Merged
merged 1 commit into from Jul 4, 2018

Conversation

Projects
None yet
4 participants
@sebastiandedeyne
Copy link
Contributor

sebastiandedeyne commented Jul 3, 2018

This PR allows you to use a tuple notation for generating action urls. This is especially useful when importing a controller class.

action([FooController::class, 'bar']);

I think it'd make sense to do this in the router too, but that's a but trickier because we'd need to detect if it's an associative array (for ['uses' => '...']) first.

@sisve

This comment has been minimized.

Copy link
Contributor

sisve commented Jul 3, 2018

Do we have anything called "tuple notation" in the framework already? This looks like php's builtin callable syntax.

@devcircus

This comment has been minimized.

Copy link
Contributor

devcircus commented Jul 3, 2018

Seems like this callable syntax was PRd for routes a few weeks ago.

@taylorotwell taylorotwell merged commit 2b3902a into laravel:master Jul 4, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Jul 4, 2018

Send a docs PR to master branch if you don't mind.

@sebastiandedeyne

This comment has been minimized.

Copy link
Contributor Author

sebastiandedeyne commented Jul 4, 2018

@sisve The exact name doesn't really matter since it doesn't exist in the code, just this PR title :) "Callable syntax" makes more sense though, if it ends up in the docs I'll write it like that.

@devcircus Thanks for mentioning, will hold off on that then.


Added to my todo list, I'll send a docs PR later this week 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.