From 2166899721b89ac5449e3f60136c10c70b4ca567 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:52:50 +0100 Subject: [PATCH] feat: Discord notification settings Model --- app/Models/DiscordNotificationSettings.php | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/Models/DiscordNotificationSettings.php diff --git a/app/Models/DiscordNotificationSettings.php b/app/Models/DiscordNotificationSettings.php new file mode 100644 index 000000000..619393ddc --- /dev/null +++ b/app/Models/DiscordNotificationSettings.php @@ -0,0 +1,59 @@ + 'boolean', + 'discord_webhook_url' => 'encrypted', + + 'deployment_success_discord_notifications' => 'boolean', + 'deployment_failure_discord_notifications' => 'boolean', + 'status_change_discord_notifications' => 'boolean', + 'backup_success_discord_notifications' => 'boolean', + 'backup_failure_discord_notifications' => 'boolean', + 'scheduled_task_success_discord_notifications' => 'boolean', + 'scheduled_task_failure_discord_notifications' => 'boolean', + 'docker_cleanup_discord_notifications' => 'boolean', + 'server_disk_usage_discord_notifications' => 'boolean', + 'server_reachable_discord_notifications' => 'boolean', + 'server_unreachable_discord_notifications' => 'boolean', + ]; + + public function team() + { + return $this->belongsTo(Team::class); + } + + public function isEnabled() + { + return $this->discord_enabled; + } +}