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

[1.x] Add Jetstream route prefix config #362

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Conversation

MaFx
Copy link
Contributor

@MaFx MaFx commented Oct 19, 2020

This PR adds config for prefixing jetstream routes in the same pattern that is used in Laravel Fortify route binding.

This allows adding prefix like /admin to routes if the application requires changes in url structure.

@taylorotwell
Copy link
Member

taylorotwell commented Oct 19, 2020

Why? Is there a particular reasons many applications would want to customize this?

@MaFx
Copy link
Contributor Author

MaFx commented Oct 19, 2020

An example of the implementation would be using the /admin prefix for all authenticated routes.
It seems that the only other alternative for changing route paths is deregistering the routes from Jetstream and re-binding all of them in app level through Laravel\Jetstream\Jetstream::$registersRoutes.

This exact implementation already exists in Fortify and the consistency of being able to do the same in Jetstream would make sense https://github.com/laravel/fortify/blob/1.x/src/FortifyServiceProvider.php#L128

@bilogic
Copy link

bilogic commented Oct 19, 2020

@MaFx I thought it would be good if this option also shows up in the config/jetstream.php.

@taylorotwell taylorotwell merged commit a01de7c into laravel:1.x Oct 19, 2020
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

3 participants