Why the plural form of a controller's name is not allowed?

#1

There are cases where I want to name a controller in a plural form. If I run:

adonis make:controller Users --type http

I get UserController.js created, not UsersController.js.

So I thought the last is always cut off by AdonisJs, thus I tried this:

// Userss instead of Users
adonis make:controller Users --type http

And all what I got is: UserssController.js

Why AdonisJs does not let us use the plural form of a controller’s name ? Any reason for this restriction? How come convention over configuration applies here?

Or is there a way to achieve what I want ?

0 Likes

#2

Create the controller manually.

I often use GetUserController.js and GetUsersController.js

1 Like