2025-10-10 13:37:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
|
|
|
|
|
|
class WebhookNotificationSettings extends Model
|
|
|
|
|
{
|
|
|
|
|
use Notifiable;
|
|
|
|
|
|
|
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'team_id',
|
|
|
|
|
|
|
|
|
|
'webhook_enabled',
|
|
|
|
|
'webhook_url',
|
|
|
|
|
|
|
|
|
|
'deployment_success_webhook_notifications',
|
|
|
|
|
'deployment_failure_webhook_notifications',
|
|
|
|
|
'status_change_webhook_notifications',
|
|
|
|
|
'backup_success_webhook_notifications',
|
|
|
|
|
'backup_failure_webhook_notifications',
|
|
|
|
|
'scheduled_task_success_webhook_notifications',
|
|
|
|
|
'scheduled_task_failure_webhook_notifications',
|
2025-11-25 14:35:01 +00:00
|
|
|
'docker_cleanup_success_webhook_notifications',
|
|
|
|
|
'docker_cleanup_failure_webhook_notifications',
|
2025-10-10 13:37:00 +00:00
|
|
|
'server_disk_usage_webhook_notifications',
|
|
|
|
|
'server_reachable_webhook_notifications',
|
|
|
|
|
'server_unreachable_webhook_notifications',
|
|
|
|
|
'server_patch_webhook_notifications',
|
2025-11-13 12:38:57 +00:00
|
|
|
'traefik_outdated_webhook_notifications',
|
2025-10-10 13:37:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected function casts(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'webhook_enabled' => 'boolean',
|
|
|
|
|
'webhook_url' => 'encrypted',
|
|
|
|
|
|
|
|
|
|
'deployment_success_webhook_notifications' => 'boolean',
|
|
|
|
|
'deployment_failure_webhook_notifications' => 'boolean',
|
|
|
|
|
'status_change_webhook_notifications' => 'boolean',
|
|
|
|
|
'backup_success_webhook_notifications' => 'boolean',
|
|
|
|
|
'backup_failure_webhook_notifications' => 'boolean',
|
|
|
|
|
'scheduled_task_success_webhook_notifications' => 'boolean',
|
|
|
|
|
'scheduled_task_failure_webhook_notifications' => 'boolean',
|
2025-11-25 14:35:01 +00:00
|
|
|
'docker_cleanup_success_webhook_notifications' => 'boolean',
|
|
|
|
|
'docker_cleanup_failure_webhook_notifications' => 'boolean',
|
2025-10-10 13:37:00 +00:00
|
|
|
'server_disk_usage_webhook_notifications' => 'boolean',
|
|
|
|
|
'server_reachable_webhook_notifications' => 'boolean',
|
|
|
|
|
'server_unreachable_webhook_notifications' => 'boolean',
|
|
|
|
|
'server_patch_webhook_notifications' => 'boolean',
|
2025-11-13 12:38:57 +00:00
|
|
|
'traefik_outdated_webhook_notifications' => 'boolean',
|
2025-10-10 13:37:00 +00:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function team()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Team::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isEnabled()
|
|
|
|
|
{
|
|
|
|
|
return $this->webhook_enabled;
|
|
|
|
|
}
|
|
|
|
|
}
|