*/ protected $fillable = [ 'login', 'email', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'social_id', 'securitycode' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', 'status' => AccountStatusEnum::class ]; /** * Determine if the user has verified their email address. * * @return bool */ public function hasVerifiedEmail(): bool { return $this->status != AccountStatusEnum::NOT_AVAILABLE; } /** * Mark the given user's email as verified. * * @return bool */ public function markEmailAsVerified(): bool { return $this->forceFill([ 'status' => AccountStatusEnum::OK, ])->save(); } /** * Send the email verification notification. * * @return void */ public function sendEmailVerificationNotification(): void { $this->notify(new VerifyEmail); } /** * Get the email address that should be used for verification. * * @return string */ public function getEmailForVerification(): string { return $this->email; } }