blueprint
blueprint copied to clipboard
Allow plural route naming convention
Synopsis:
First of all, thank you so much for this amazing package! It saves me a ton of time.
I'm not sure whether this is intentional, but according to Laravel and REST naming conventions, the route URIs should be in plural form.
Refferences:
- https://github.com/alexeymezenin/laravel-best-practices#follow-laravel-naming-conventions
- https://restfulapi.net/resource-naming/
- https://laravel.com/docs/8.x/controllers#resource-controllers
Proposed Syntax:
Expected Behavior:
Currently, the generated routes are in the singular form. For example:
controllers:
Post:
resource: api
Generates:
Route::apiResource('post', App\Http\Controllers\PostController::class);
Instead, it should be:
Route::apiResource('posts', App\Http\Controllers\PostController::class);
I am open to adding a configuration option for generating plural routes, view, etc. However, per the previous PR, this is not a small task. I will leave this open for the community to implement if wanted.
Merged in #574