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

+4 -2
View File
@@ -98,7 +98,8 @@ class User extends Authenticatable implements SendsEmail
$team['id'] = 0;
$team['name'] = 'Root Team';
}
$new_team = Team::forceCreate($team);
$new_team = (new Team)->forceFill($team);
$new_team->save();
$user->teams()->attach($new_team, ['role' => 'owner']);
});
@@ -201,7 +202,8 @@ class User extends Authenticatable implements SendsEmail
$team['id'] = 0;
$team['name'] = 'Root Team';
}
$new_team = Team::forceCreate($team);
$new_team = (new Team)->forceFill($team);
$new_team->save();
$this->teams()->attach($new_team, ['role' => 'owner']);
return $new_team;