mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 20:17:05 +00:00
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:
1 parent
1a603a10ed
commit
a77e1f47d1
3 files changed
+13
-9
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user