text: 'use strict'
  
  const Transformer = use('App/Libs/Transformer')
  
  class User extends Transformer {
  
    constructor (Instance) {
      super()
      if(Instance){
          Object.assign(this, Instance)
      }
  
      this.table = 'users'
    }
  
    static boot () {
      super.boot()
      /**
       * A hook to bash the user password before saving
       * it to the database.
       *
       * Look at `app/Models/Hooks/User.js` file to
       * check the hashPassword method
       */
      this.addHook('beforeCreate', 'User.hashPassword')
    }
  
    /**
     * A relationship on tokens is required for auth to
     * work. Since features like `refreshTokens` or
     * `rememberToken` will be saved inside the
     * tokens table.
     *
     * @method tokens
     *
     * @return {Object}
     */
    tokens () {
      return this.hasMany('App/Models/Token')
    }
  
  }
  
  module.exports = User
  