From a70a0603500427dd500ef0c810fc0428527f6e01 Mon Sep 17 00:00:00 2001 From: MartinOscar <40749467+RMartinOscar@users.noreply.github.com> Date: Sun, 27 Oct 2024 05:42:08 +0100 Subject: [PATCH] Add Soft Deletes to webhooks config table (#670) --- app/Models/WebhookConfiguration.php | 3 +- ...date_webhook_configurations_softdelete.php | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2024_10_27_033218_update_webhook_configurations_softdelete.php diff --git a/app/Models/WebhookConfiguration.php b/app/Models/WebhookConfiguration.php index 092eac334..1f3803046 100644 --- a/app/Models/WebhookConfiguration.php +++ b/app/Models/WebhookConfiguration.php @@ -5,11 +5,12 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\File; class WebhookConfiguration extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $fillable = [ 'endpoint', diff --git a/database/migrations/2024_10_27_033218_update_webhook_configurations_softdelete.php b/database/migrations/2024_10_27_033218_update_webhook_configurations_softdelete.php new file mode 100644 index 000000000..2f95aee58 --- /dev/null +++ b/database/migrations/2024_10_27_033218_update_webhook_configurations_softdelete.php @@ -0,0 +1,28 @@ +softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('webhook_configurations', function (Blueprint $table) { + $table->dropSoftDeletes(); + }); + } +};