blueprint
blueprint copied to clipboard
Default to plural api route naming, with config to allow plural or singular
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
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.
I'm going to be working on Blueprint in my live streams during the month of October. I will start with this.
Nice, subscribed :muscle:
Given the age, I am closing. However, I have used this work to create #574.