'string', 'user_id' => 'string', 'should_encrypt' => 'boolean' ]; public static function boot() { parent::boot(); Recipient::deleting(function ($recipient) { if ($recipient->fingerprint) { $recipient->user->deleteKeyFromKeyring($recipient->fingerprint); } $recipient->aliases()->detach(); }); } /** * Get the user the recipient belongs to. */ public function user() { return $this->belongsTo(User::class); } /** * Get the aliases that have this recipient attached. */ public function aliases() { return $this->belongsToMany(Alias::class, 'alias_recipients')->using(AliasRecipient::class); } /** * Determine if the recipient has a verified email address. * * @return bool */ public function hasVerifiedEmail() { return ! is_null($this->email_verified_at); } /** * Mark this recipient's email as verified. * * @return bool */ public function markEmailAsVerified() { return $this->forceFill([ 'email_verified_at' => $this->freshTimestamp(), ])->save(); } /** * Send the email verification notification. * * @return void */ public function sendEmailVerificationNotification() { $this->notify(new VerifyEmail); } /** * Get the email address that should be used for verification. * * @return string */ public function getEmailForVerification() { return $this->email; } }