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

Feature Request: Allow customization of route naming conventions #92

Open
shawnveltman opened this issue Dec 8, 2018 · 3 comments
Open

Comments

@shawnveltman
Copy link

First and foremost, I cannot express my admiration for the work everybody here is doing enough! This is an amazingly helpful project!!!

The feature request I'm suggesting is a way to customize some of the "baked in" options, specifically the route naming convention - apologies if this has been covered elsewhere.

Right now, the routes.stub file has magic methods for things like "index_route_name" and "create_route_name". Those end up defaulting out to models.model.index and models.model.show by default.

The coding style in my company is to use much sorter route names, and I'd love to be able to overwrite the current stubs to use the preferred formatting.

Thanks for considering this!

@MikeAlhayek
Copy link
Collaborator

Hi,

This could be added in future releases. However, you may be able to utilize existing options/configurations to do what you need. Can you please explain what are you trying to do here? Or how do you foresee the route name?

@shawnveltman
Copy link
Author

Thanks for the quick response!

In this specific example, I'd like to ensure that the route conventions in my project are changed from "models.model.index" to just "models", and for the rest to follow the convention "model.show"/"model.edit" etc (both in the routes file, as well as in all the generated views obviously)

@MikeAlhayek
Copy link
Collaborator

How are you going to differentiate between the different actions methods on your controller? Also, what value would having a different name add to your project?

If you want to add a prefix to your existing route like for "frontend" and "backend" you would upgrate the the v2.3 which is not out yet. v2.3 gives you an option to add a prefix https://github.com/CrestApps/laravel-code-generator/blob/v2.3/src/Commands/Framework/CreateRoutesCommand.php here is v2.3 https://github.com/CrestApps/laravel-code-generator/tree/v2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants