'datetime', ]; protected $primaryKey = 'id'; protected $keyType = 'uuid'; public $incrementing = false; public static function loginRules() { return [ 'email' => 'required', 'password' => 'required' ]; } public static function registerRules() { return [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'] ]; } public static function updateRules() { return [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'] ]; } public function verification() { return $this->hasOne('\App\Auth\EmailVerification'); } /** * Returns a user's login sessions * * @return mixed */ public function sessions() { return $this->hasMany('\App\Auth\LoginSession'); } /** * Get the identifier that will be stored in the subject claim of the JWT. * * @return mixed */ public function getJWTIdentifier() { return $this->getKey(); } /** * Return a key value array, containing any custom claims to be added to the JWT. * * @return array */ public function getJWTCustomClaims() { return []; } public function setPasswordAttribute($password) { if ( !empty($password) ) { $this->attributes['password'] = Hash::make($password); } } }