related; } /** * Get the foreign model. * * @return TModelForeign&Nameable */ public function getForeign(): Model&Nameable { return $this->foreign; } /** * Get the user that has fired this event. * * @return User|null */ protected function getAuthenticatedUser(): ?User { return Auth::user(); } /** * Get the user info for the footer. * * @return array */ protected function getUserFooter(): array { if (is_null($this->getAuthenticatedUser())) { return []; } return [ 'footer' => [ 'text' => $this->getAuthenticatedUser()->getName(), 'icon_url' => $this->getAuthenticatedUser()->getFilamentAvatarUrl(), ] ]; } /** * Get Discord channel the message will be sent to. * * @return string */ public function getDiscordChannel(): string { return Config::get(ServiceConstants::DB_UPDATES_DISCORD_CHANNEL_QUALIFIED); } /** * Determine if the message should be sent. * * @return bool */ public function shouldSendDiscordMessage(): bool { return true; } /** * Get the description for the Discord message payload. * * @return string */ abstract protected function getDiscordMessageDescription(): string; }