-
Notifications
You must be signed in to change notification settings - Fork 288
Default to plural api route naming, with config to allow plural or singular #544
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
Default to plural api route naming, with config to allow plural or singular #544
Conversation
…ngular. Fixes laravel-shift#480 Signed-off-by: Ben James <in@benjam.es>
It really depends on how deep the developer feels the plural should go: route? controller name? view folder name? etc... In this end, this is one developers opinion. As such, it's unlikely I would merge this without some consensus. |
My reading of issue #480 is that he is referencing the widely used (opinions vary) api resource naming convention using plural naming. So in this instance, I think it stands alone, and the pull request meets that one request only (with added config so its not strictly enforced). |
While I have seen devs use both plural and singular resource routes, I believe the plural form is more common and is in accordance with Laravel docs and REST naming conventions. The only other thing I usually pluralize is the view folder name. But I'm not sure what the norm is in that regard. So I agree with Jason that we need some consensus. |
I think the option for routes is good. It's really a matter if we want to also pluralize the views folder. |
I think @pktharindu's raised issue (#480) offers a better sensible default for api resources, so think the pull request has merit for that reason. I'm happy to amend or delete if needed. |
Agreed. I will merge this as-is. However, trying to ask if either of you feel we should pluralize the views folder when this option is enabled? |
View folders are usually named after the routes, which makes them easier to find IMHO. Package like spatie/laravel-route-discovery seems to follow the same convention. So, I think it is a sensible thing to do so. What do you guys think? |
Yes views folder no controller |
Yes pls merge this, it's the only reason I'm unable to use this package. It's great what this package has to offer but forcing singular is a big entry barrier for me as all my projects follow the plural naming conventions for routes(including web routes) and view folders. |
I'm going to be working on Blueprint in my live streams during the month of October. I will start with this. |
That would be wonderful. |
Nice, subscribed 💪 |
Given the age, I am closing. However, I have used this work to create #574. |
Fixes #480
Issue created requiring plural api resource slugs. Hopefully this covers the issue as you requested @pktharindu?
This implementation seems very simple, so there may be more needed, so happy to take any pointers @jasonmccreary or @pktharindu