Skip to content

Conversation

benjam-es
Copy link
Contributor

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

@jasonmccreary
Copy link
Collaborator

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.

@benjam-es
Copy link
Contributor Author

benjam-es commented Feb 11, 2022

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).

@pktharindu
Copy link

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.

@jasonmccreary
Copy link
Collaborator

I think the option for routes is good. It's really a matter if we want to also pluralize the views folder.

@benjam-es
Copy link
Contributor Author

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.

@jasonmccreary
Copy link
Collaborator

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?

@pktharindu
Copy link

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?

@dillingham
Copy link

Yes views folder no controller

@dalpat
Copy link

dalpat commented Sep 23, 2022

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.

@jasonmccreary
Copy link
Collaborator

I'm going to be working on Blueprint in my live streams during the month of October. I will start with this.

@dalpat
Copy link

dalpat commented Sep 23, 2022

That would be wonderful.

@spekulatius
Copy link
Contributor

I'm going to be working on Blueprint in my live streams during the month of October. I will start with this.

Nice, subscribed 💪

@jasonmccreary
Copy link
Collaborator

Given the age, I am closing. However, I have used this work to create #574.

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.

Allow plural route naming convention

6 participants