From 3f2f1cf966c01076a3c607102e4cae5473d5a112 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:14:44 +0100 Subject: [PATCH] chore(core): EnvironmentVariable Model now extends BaseModel to remove duplicated code --- app/Models/EnvironmentVariable.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.php index 507ff0d7e..5f686de60 100644 --- a/app/Models/EnvironmentVariable.php +++ b/app/Models/EnvironmentVariable.php @@ -4,9 +4,7 @@ namespace App\Models; use App\Models\EnvironmentVariable as ModelsEnvironmentVariable; use Illuminate\Database\Eloquent\Casts\Attribute; -use Illuminate\Database\Eloquent\Model; use OpenApi\Attributes as OA; -use Visus\Cuid2\Cuid2; #[OA\Schema( description: 'Environment Variable model', @@ -30,7 +28,7 @@ use Visus\Cuid2\Cuid2; 'updated_at' => ['type' => 'string'], ] )] -class EnvironmentVariable extends Model +class EnvironmentVariable extends BaseModel { protected $guarded = []; @@ -49,12 +47,6 @@ class EnvironmentVariable extends Model protected static function booted() { - static::creating(function (Model $model) { - if (! $model->uuid) { - $model->uuid = (string) new Cuid2; - } - }); - static::created(function (EnvironmentVariable $environment_variable) { if ($environment_variable->resourceable_type === Application::class && ! $environment_variable->is_preview) { $found = ModelsEnvironmentVariable::where('key', $environment_variable->key)