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

Plural routes by default #663

Merged
merged 3 commits into from
Feb 3, 2024
Merged

Plural routes by default #663

merged 3 commits into from
Feb 3, 2024

Conversation

bertheyman
Copy link
Contributor

This uses the plural of a modal for resource controllers by default to match the examples in the Laravel docs as discussed in #662 . Singular still remains possible via a config setting.

I checked the docs and could not find any references to the singular ones, so no need for changes there as far as I could see.

@jasonmccreary
Copy link
Collaborator

This is great. Please fix the linting errors.

Also, what about the views path? Again, probably not something documented, but I would imagine they should be plural by default too?

@bertheyman
Copy link
Contributor Author

Thanks for checking!
I've fixed the linting error.

For the views path, the most official I could find are some examples from the docs.

Most use stuff like 'welcome.blade.php', but anything model related does use singular.

Example from the docs:

// Route definition...
Route::get('/users/{user}', [UserController::class, 'show']);
 
// Controller method definition...
public function show(User $user)
{
    return view('user.profile', ['user' => $user]);
}

The mailing section also uses singular.

TL;DR: current approach of Blueprint matches view folder conventions from the docs.

@jasonmccreary
Copy link
Collaborator

Fair enough. Thanks for this!

@jasonmccreary jasonmccreary merged commit 98f6805 into laravel-shift:master Feb 3, 2024
8 checks passed
@bertheyman bertheyman deleted the plural-routes-by-default branch February 3, 2024 16:50
@jasonmccreary jasonmccreary mentioned this pull request Feb 29, 2024
4 tasks
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.

None yet

2 participants