Skip to content

[5.6] Allow for fluent registration of Route Resources to return a RouteCollection - #23890

Merged
taylorotwell merged 2 commits into
laravel:5.6from
DanielCoulbourne:cause-resource-registrar-to-return-a-route-collection
Apr 16, 2018
Merged

taylorotwell merged 2 commits into
laravel:5.6from
DanielCoulbourne:cause-resource-registrar-to-return-a-route-collection

Conversation

@DanielCoulbourne

@DanielCoulbourne DanielCoulbourne commented Apr 16, 2018

Copy link
Copy Markdown
Contributor

This PR allows for manual Registration of fluent Route Resource chains (which currently remain as a PendingResourceRegistration until destruction.

Now upon registration they return a RouteCollection like so:

Route::resource('photos', 'PhotoController')->register() // Returns a RouteCollection

The ResourceRegistrar::register() method previously returned void but based on the fact that it's not publicly accessible, I don't think this should be considered a breaking change 🤞

While I recognize that this PR probably doesn't add a ton of value to the community at large, it won't make anyone's life worse and will make my life much nicer 😄

@DanielCoulbourne
DanielCoulbourne force-pushed the cause-resource-registrar-to-return-a-route-collection branch 2 times, most recently from c46a456 to 368fd25 Compare April 16, 2018 09:07
@DanielCoulbourne
DanielCoulbourne force-pushed the cause-resource-registrar-to-return-a-route-collection branch from 368fd25 to 4ba828b Compare April 16, 2018 09:08
@DanielCoulbourne DanielCoulbourne changed the title Cause ResourceRegistrar::register() to return a RouteCollection. Allow for fluent registration of Route Resources to return a RouteCollection Apr 16, 2018
@taylorotwell
taylorotwell merged commit 4ba828b into laravel:5.6 Apr 16, 2018
@GrahamCampbell GrahamCampbell changed the title Allow for fluent registration of Route Resources to return a RouteCollection [5.6] Allow for fluent registration of Route Resources to return a RouteCollection Apr 16, 2018
@sisve

sisve commented Apr 16, 2018

Copy link
Copy Markdown
Contributor

[...] based on the fact that it's not publicly accessible [...]

All the methods you've changed are public. How is this not publicly accessible?

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