Validator folder structure

Is there any method to divide Validators into folders?

\app\Validators\Validator1\Validator1_1\

How to use it in route.js than?

1 Like

Hello @dwa6

Yes you can

route.js

define path structure with / operator. Like :

Route.get('/', () => { return 'hello' }).validator(['v1/UserCreation'])

Validation file path : app/Validators/v1/UserCreation.js

Validator command

> adonis make:validator v1/UserCreation
3 Likes

Many thanks Bastien. It works.

1 Like