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

[4.x] Add config to (re-)enable front end route binding and support binding by field #8853

Merged
merged 20 commits into from
Oct 18, 2023

Conversation

ryanmitchell
Copy link
Contributor

@ryanmitchell ryanmitchell commented Oct 16, 2023

Way back when front end route binding was disabled (the irony is not lost, it was my request) to prevent conflicts with other packages. In hindsight, maybe this should have been a config, as it can be useful to have this on the front end.

This PR adds a statamic.routes.bindings => true config to re-enable it.

At the same time it also allows the field you are binding on be specified... eg:

Route::get('test/{entry:title}', function (Request $request, \Statamic\Contracts\Entries\Entry $entry) { });

Adds support for some of statamic/ideas#360 - You can make custom routes, but it doesn't add support for field bindings in yaml based routes.

@ryanmitchell ryanmitchell changed the title Add config to (re-)enable front end route binding and support binding by field [4.x] Add config to (re-)enable front end route binding and support binding by field Oct 16, 2023
@edalzell
Copy link
Contributor

Closes #360

Don't think this is right.

@ryanmitchell
Copy link
Contributor Author

Closes #360

Don't think this is right.

Yeah should have been on the ideas repo. thanks.

@ryanmitchell ryanmitchell marked this pull request as ready for review October 16, 2023 16:35
@jasonvarga
Copy link
Member

I wanted to add test coverage to this and it kinda snowballed. 😅 Lots of combinations of stuff. I wanted to make sure we don't end up screwing something up in here in the future. I'm sure I've missed something though.

@ryanmitchell
Copy link
Contributor Author

It definitely snowballed 😀
This looks a lot better now, thanks.

@jasonvarga jasonvarga merged commit 497b845 into statamic:4.x Oct 18, 2023
19 checks passed
@ryanmitchell ryanmitchell deleted the feature/front-end-route-binding branch October 18, 2023 14:51
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