In my opinion, GET /api/user returning the list of all users is unclear as it sounds like a single entity, so it should be GET /api/users. What do you think about that? Is there a standard I'm missing?
I like this suggestion! I am used to matching the name of my routes to the table it corresponds, because Laravel's router will generate the routes for you like this:
Route::resource("user","UserController");
This will automatically create these routes for you:
I guess it is a matter of habit for me 😅 Anyway, I think using /api/users for the list of users makes a lot more sense for routes that are served to end users, so good point here!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi nice post.
In my opinion, GET /api/user returning the list of all users is unclear as it sounds like a single entity, so it should be GET /api/users. What do you think about that? Is there a standard I'm missing?
I like this suggestion! I am used to matching the name of my routes to the table it corresponds, because Laravel's router will generate the routes for you like this:
This will automatically create these routes for you:
I guess it is a matter of habit for me 😅 Anyway, I think using
/api/users
for the list of users makes a lot more sense for routes that are served to end users, so good point here!