mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-18 06:25:53 +00:00
refactor: use forceCreate() for internal model creation
Replace create() with forceCreate() across internal model creation operations to bypass mass assignment protection. This is appropriate for internal code that constructs complete model state without user input. Add InternalModelCreationMassAssignmentTest to ensure internal model creation behavior is properly tested. Optimize imports by using shortened Livewire attribute references and removing unused imports.
This commit is contained in:
@@ -51,10 +51,10 @@ class Project extends BaseModel
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function ($project) {
|
||||
ProjectSetting::create([
|
||||
ProjectSetting::forceCreate([
|
||||
'project_id' => $project->id,
|
||||
]);
|
||||
Environment::create([
|
||||
Environment::forceCreate([
|
||||
'name' => 'production',
|
||||
'project_id' => $project->id,
|
||||
'uuid' => (string) new Cuid2,
|
||||
|
||||
Reference in New Issue
Block a user