akc4's avatar
Level 1

Should you pluralize routes?

Should I pluralize routes or is there an unwritten rule to leave them in singular?

Such as:

Route::resource('product', ProductController::class);

Route::resource('products', ProductController::class);

Thanks

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

Plural. You have effectively a Collection of products, think of it like an array.

3 likes
jlrdw's avatar

Either way. The documentation has this example:

Route::get('/user', [UserController::class, 'index']);

But users would also work. So it's personal preference.

3 likes

Please or to participate in this conversation.