Validations not working


#1

Currently trying out to get Validations to work. I’m using the Adonis Blog example project, but somehow when wanting to create a user there is no Validation running not even a Validation message is showing. validation.fails() always says true even tho everything is filled and unique.

Any one an idea? Code, just in case anyone needs it: https://github.com/adonisjs/adonis-blog-demo/blob/master/app/Controllers/Http/UserController.js#L24+L45


#2

Hey @visualcookie! :wave:

I’m going to update the demo application to 4.1, I’ll let you know when it’s done so you can try again.


#3

Hey friend,

Go to your app.js file and check whether you have these providers

const providers = [
@adonisjs/framework/providers/AppProvider’,
@adonisjs/framework/providers/ViewProvider’,
@adonisjs/lucid/providers/LucidProvider’,
@adonisjs/bodyparser/providers/BodyParserProvider’,
@adonisjs/cors/providers/CorsProvider’,
@adonisjs/shield/providers/ShieldProvider’,
@adonisjs/session/providers/SessionProvider’,
@adonisjs/auth/providers/AuthProvider’,
@adonisjs/validator/providers/ValidatorProvider’
]