*/ abstract class DocumentDeletedEvent extends BaseDeletedEvent implements FilamentNotificationEvent { public function getDiscordChannel(): string { return Config::get(ServiceConstants::ADMIN_DISCORD_CHANNEL_QUALIFIED); } public function shouldSendFilamentNotification(): bool { $model = $this->getModel(); if ($model instanceof SoftDeletable) { return ! $model->isForceDeleting(); } return false; } public function getFilamentNotification(): Notification { return Notification::make() ->body($this->getNotificationMessage()) ->warning() ->actions([ Action::make('view') ->button() ->url($this->getFilamentNotificationUrl()), MarkAsReadAction::make(), ]); } public function getFilamentNotificationRecipients(): Collection { return User::query() ->whereRelation(User::RELATION_ROLES, Role::ATTRIBUTE_NAME, RoleEnum::ADMIN->value) ->get(); } protected function getDiscordMessageDescription(): string { return "{$this->privateLabel($this->getModel())} '**{$this->getModel()->getName()}**' has been deleted."; } protected function getNotificationMessage(): string { return "{$this->privateLabel($this->getModel())} '{$this->getModel()->getName()}' has been deleted. It will be automatically pruned in one week. Please review."; } /** * Get the URL for the filament notification. */ abstract protected function getFilamentNotificationUrl(): string; }