*/ /** * The attributes that should be hidden for serialization. * * @var array */ public function __construct() { $this->guarded = [ //'password', //'email', 'remember_token' ]; $this->hidden = [ 'password', 'remember_token' ]; $this->casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; $this->appends = [ 'path_avatar' ]; } public function getPathAvatarAttribute() { if (!empty($this->avatar)) { return asset('/storage/' . $this->avatar); } return asset('img/avatar.png'); } /** * Send the password reset notification. * * @param string $token * @return void */ public function sendPasswordResetNotification($token) { $this->notify(new ResetPasswordMail($token)); } public function sendEmailVerificationNotification() { $this->notify(new VerifyEmail($this)); } }