laravel-shift / blueprint

A code generation tool for Laravel developers.
MIT License
2.82k stars 270 forks source link

Plural routes by default #663

Closed bertheyman closed 7 months ago

bertheyman commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

Fair enough. Thanks for this!