attributes['password'] = bcrypt($value); } public function setBirthdayAttribute($value) { $this->attributes['birthday'] = trim($value) ?: null; } public function gravatar() { $hash = hash('md5', strtolower(trim($this->attributes['email']))); return sprintf("https://www.gravatar.com/avatar/%s?size=150", $hash); } public function isUnconfirmed() { return $this->status == UserStatus::UNCONFIRMED; } public function isActive() { return $this->status == UserStatus::ACTIVE; } public function isBanned() { return $this->status == UserStatus::BANNED; } public function country() { return $this->belongsTo(Country::class, 'country_id'); } /** * Send the password reset notification. * * @param string $token * @return void */ public function sendPasswordResetNotification($token) { Mail::to($this)->send(new \Vanguard\Mail\ResetPassword($token)); event(new RequestedPasswordResetEmail($this)); } }