adonis hook

Solutions on MaxInterview for adonis hook by the best coders in the world

showing results for - "adonis hook"
Juline
04 Jul 2017
1class User extends Model {
2  static boot () {
3    super.boot()
4
5    this.addHook('beforeCreate', async (userInstance) => {
6      userInstance.password = await Hash.make(userInstance.password)
7    })
8  }
9}