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.5] Added domain helper to route #19245

Merged
merged 2 commits into from
May 18, 2017
Merged

[5.5] Added domain helper to route #19245

merged 2 commits into from
May 18, 2017

Conversation

m1guelpf
Copy link
Contributor

Originally sent by @robinvdvleuten to 5.4 branch in #19243, submitting to 5.5 branch

Originally sent by @robinvdvleuten to 5.4 branch, submitting to 5.5 branch
@m1guelpf m1guelpf changed the title Added domain helper to route [5.5] Added domain helper to route May 17, 2017
@robinvdvleuten
Copy link
Contributor

Nice! Thanks @m1guelpf!

@deleugpn
Copy link
Contributor

deleugpn commented May 17, 2017

@m1guelpf I opened a PR on your fork (https://github.com/m1guelpf/framework/pull/1) to add a specific test for this. The test passes on your master but would fail without the new feature.
I noticed that this PR corrects some of the tests that would be broken, but currently it doesn't really have a test for this specifically. I think if you merge the PR the commit should show up here automatically.

@m1guelpf
Copy link
Contributor Author

m1guelpf commented May 17, 2017

@deleugpn Thank you! Merged

@deleugpn
Copy link
Contributor

PR

@ntzm
Copy link
Contributor

ntzm commented May 17, 2017

I'd rather transitioning from 5.4 to 5.5 to be as simple as possible, but changing things like this will make it more difficult. I'm not saying I disagree with the feature, I'd just rather it not change the current behaviour to be honest.

@m1guelpf
Copy link
Contributor Author

m1guelpf commented May 17, 2017

Maybe it would be better to keep current domain() functionality, but use the new functionality when passing a parameter, like:

domain()

would act as it does now, but

domain($domain)

would do new behaviour.
What do @taylorotwell & @themsaid think about this?

@deleugpn
Copy link
Contributor

I think it would be quite weird to have a method that return either a string or a Route object.

@robinvdvleuten
Copy link
Contributor

I tried to stay as close to the Laravel API as possible; if you would like to add a prefix you call prefix('/api') but if you want to get the prefix of the route you'll call getPrefix().

@decadence
Copy link
Contributor

AFAIK now you can define domain only on route group. Does this PR bring opportunity to define domain for every single Route? Or I misunderstood something?

@deleugpn
Copy link
Contributor

deleugpn commented May 17, 2017

@decadence I would infer that it does since the test I wrote for this do exactly that.

@taylorotwell
Copy link
Member

@m1guelpf yes you should make the existing domain method function as both a getter and setter depending on if an argument is passed. We do that in other parts of the framework occasionally.

@taylorotwell
Copy link
Member

Eh, nevermind, I guess we have other get* methods on this class.

@taylorotwell taylorotwell merged commit 7d0b766 into laravel:master May 18, 2017
@m1guelpf m1guelpf deleted the master branch May 18, 2017 15:15
@joshmanders
Copy link
Contributor

Excellent PR!

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.

None yet

7 participants