fix(models): replace forceCreate with forceFill+save pattern

Replaces Model::forceCreate([...]) calls with (new Model)->forceFill([...])->save()
across SettingsBackup, Server, and User models to avoid bypassing Eloquent
model event lifecycle during record creation.
This commit is contained in:
Andras Bacsai committed 2026-03-31 13:50:37 +02:00
1 parent 1a603a10ed
commit a77e1f47d1
3 files changed
+13 -9

No files matched your search

+3 -1
View File
@@ -83,7 +83,8 @@ class SettingsBackup extends Component
$postgres_password = $envs['POSTGRES_PASSWORD'];
$postgres_user = $envs['POSTGRES_USER'];
$postgres_db = $envs['POSTGRES_DB'];
$this->database = StandalonePostgresql::forceCreate([
$this->database = new StandalonePostgresql;
$this->database->forceFill([
'id' => 0,
'name' => 'coolify-db',
'description' => 'Coolify database',
@@ -94,6 +95,7 @@ class SettingsBackup extends Component
'destination_type' => StandaloneDocker::class,
'destination_id' => 0,
]);
$this->database->save();
$this->backup = ScheduledDatabaseBackup::create([
'id' => 0,
'enabled' => true,