Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

adonis hook

class User extends Model {
  static boot () {
    super.boot()

    this.addHook('beforeCreate', async (userInstance) => {
      userInstance.password = await Hash.make(userInstance.password)
    })
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native button 
Javascript :: jquery datepicker re initialize 
Javascript :: footer dynamic copyright reactjs 
Javascript :: fetch api post req 
Javascript :: javascript unique array of objects by property 
Javascript :: Chart is not a constructor 
Javascript :: how do i get month and date of javascript in 2 digit format 
Javascript :: ReferenceError: window is not defined 
Javascript :: jquery first child 
Javascript :: Math prime js 
Javascript :: find in array of objects javascript 
Javascript :: regex for lowercase letters js 
Javascript :: jquery on click 
Javascript :: getting data from firestore using async await 
Javascript :: Get the value of selected radio button 
Javascript :: get id button clicked react 
Javascript :: phone number validation regex 
Javascript :: how to encode a string in javascript 
Javascript :: how to start json server 
Javascript :: Nazmul 
Javascript :: how to clean react native project 
Javascript :: convert object to json javascript 
Javascript :: how to push a file to github 
Javascript :: javascript call function on click give element id 
Javascript :: how to keep scrolling with javascript 
Javascript :: showing an image in react js 
Javascript :: font awesome react npm 
Javascript :: javascript css left 
Javascript :: redirect to different page in javascript 
Javascript :: javascript get x,y point on circle 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =