diff --git a/app/Actions/Fortify/ResetUserPassword.php b/app/Actions/Fortify/ResetUserPassword.php
index 158996c90..5baa8b7ed 100644
--- a/app/Actions/Fortify/ResetUserPassword.php
+++ b/app/Actions/Fortify/ResetUserPassword.php
@@ -21,7 +21,7 @@ public function reset(User $user, array $input): void
'password' => ['required', Password::defaults(), 'confirmed'],
])->validate();
- $user->forceFill([
+ $user->fill([
'password' => Hash::make($input['password']),
])->save();
$user->deleteAllSessions();
diff --git a/app/Actions/Fortify/UpdateUserPassword.php b/app/Actions/Fortify/UpdateUserPassword.php
index 0c51ec56d..320eede0b 100644
--- a/app/Actions/Fortify/UpdateUserPassword.php
+++ b/app/Actions/Fortify/UpdateUserPassword.php
@@ -24,7 +24,7 @@ public function update(User $user, array $input): void
'current_password.current_password' => __('The provided password does not match your current password.'),
])->validateWithBag('updatePassword');
- $user->forceFill([
+ $user->fill([
'password' => Hash::make($input['password']),
])->save();
}
diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php
index c8bfd930a..76c6c0736 100644
--- a/app/Actions/Fortify/UpdateUserProfileInformation.php
+++ b/app/Actions/Fortify/UpdateUserProfileInformation.php
@@ -35,7 +35,7 @@ public function update(User $user, array $input): void
) {
$this->updateVerifiedUser($user, $input);
} else {
- $user->forceFill([
+ $user->fill([
'name' => $input['name'],
'email' => $input['email'],
])->save();
@@ -49,7 +49,7 @@ public function update(User $user, array $input): void
*/
protected function updateVerifiedUser(User $user, array $input): void
{
- $user->forceFill([
+ $user->fill([
'name' => $input['name'],
'email' => $input['email'],
'email_verified_at' => null,
diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.php
index 8bb85c7fc..2e08ec6ad 100644
--- a/app/Actions/Server/InstallDocker.php
+++ b/app/Actions/Server/InstallDocker.php
@@ -49,7 +49,7 @@ public function handle(Server $server)
}');
$found = StandaloneDocker::where('server_id', $server->id);
if ($found->count() == 0 && $server->id) {
- StandaloneDocker::forceCreate([
+ StandaloneDocker::create([
'name' => 'coolify',
'network' => 'coolify',
'server_id' => $server->id,
diff --git a/app/Console/Commands/Emails.php b/app/Console/Commands/Emails.php
index 462155142..43ba06804 100644
--- a/app/Console/Commands/Emails.php
+++ b/app/Console/Commands/Emails.php
@@ -136,7 +136,7 @@ public function handle()
$application = Application::all()->first();
$preview = ApplicationPreview::all()->first();
if (! $preview) {
- $preview = ApplicationPreview::forceCreate([
+ $preview = ApplicationPreview::create([
'application_id' => $application->id,
'pull_request_id' => 1,
'pull_request_html_url' => 'http://example.com',
diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php
index c8638be0d..ec2e300ff 100644
--- a/app/Http/Controllers/Api/ProjectController.php
+++ b/app/Http/Controllers/Api/ProjectController.php
@@ -258,7 +258,7 @@ public function create_project(Request $request)
], 422);
}
- $project = Project::forceCreate([
+ $project = Project::create([
'name' => $request->name,
'description' => $request->description,
'team_id' => $teamId,
diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php
index 6a742fe1b..fbf4b9e56 100644
--- a/app/Http/Controllers/Api/ServicesController.php
+++ b/app/Http/Controllers/Api/ServicesController.php
@@ -432,7 +432,7 @@ public function create_service(Request $request)
if (in_array($oneClickServiceName, NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK)) {
data_set($servicePayload, 'connect_to_docker_network', true);
}
- $service = Service::forceCreate($servicePayload);
+ $service = Service::create($servicePayload);
$service->name = $request->name ?? "$oneClickServiceName-".$service->uuid;
$service->description = $request->description;
if ($request->has('is_container_label_escape_enabled')) {
diff --git a/app/Http/Controllers/Webhook/Bitbucket.php b/app/Http/Controllers/Webhook/Bitbucket.php
index e59bc6ead..183186711 100644
--- a/app/Http/Controllers/Webhook/Bitbucket.php
+++ b/app/Http/Controllers/Webhook/Bitbucket.php
@@ -119,7 +119,7 @@ public function manual(Request $request)
$found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) {
if ($application->build_pack === 'dockercompose') {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'bitbucket',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
@@ -128,7 +128,7 @@ public function manual(Request $request)
]);
$pr_app->generate_preview_fqdn_compose();
} else {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'bitbucket',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
diff --git a/app/Http/Controllers/Webhook/Gitea.php b/app/Http/Controllers/Webhook/Gitea.php
index 6ba4b33cf..a9d65eae6 100644
--- a/app/Http/Controllers/Webhook/Gitea.php
+++ b/app/Http/Controllers/Webhook/Gitea.php
@@ -144,7 +144,7 @@ public function manual(Request $request)
$found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) {
if ($application->build_pack === 'dockercompose') {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'gitea',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
@@ -153,7 +153,7 @@ public function manual(Request $request)
]);
$pr_app->generate_preview_fqdn_compose();
} else {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'gitea',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
diff --git a/app/Http/Controllers/Webhook/Gitlab.php b/app/Http/Controllers/Webhook/Gitlab.php
index fe4f17d9e..08e5d7162 100644
--- a/app/Http/Controllers/Webhook/Gitlab.php
+++ b/app/Http/Controllers/Webhook/Gitlab.php
@@ -177,7 +177,7 @@ public function manual(Request $request)
$found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) {
if ($application->build_pack === 'dockercompose') {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'gitlab',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
@@ -186,7 +186,7 @@ public function manual(Request $request)
]);
$pr_app->generate_preview_fqdn_compose();
} else {
- $pr_app = ApplicationPreview::forceCreate([
+ $pr_app = ApplicationPreview::create([
'git_type' => 'gitlab',
'application_id' => $application->id,
'pull_request_id' => $pull_request_id,
diff --git a/app/Jobs/ProcessGithubPullRequestWebhook.php b/app/Jobs/ProcessGithubPullRequestWebhook.php
index 01a512439..041cd812c 100644
--- a/app/Jobs/ProcessGithubPullRequestWebhook.php
+++ b/app/Jobs/ProcessGithubPullRequestWebhook.php
@@ -118,7 +118,7 @@ private function handleOpenAction(Application $application, ?GithubApp $githubAp
if (! $found) {
if ($application->build_pack === 'dockercompose') {
- $preview = ApplicationPreview::forceCreate([
+ $preview = ApplicationPreview::create([
'git_type' => 'github',
'application_id' => $application->id,
'pull_request_id' => $this->pullRequestId,
@@ -127,7 +127,7 @@ private function handleOpenAction(Application $application, ?GithubApp $githubAp
]);
$preview->generate_preview_fqdn_compose();
} else {
- $preview = ApplicationPreview::forceCreate([
+ $preview = ApplicationPreview::create([
'git_type' => 'github',
'application_id' => $application->id,
'pull_request_id' => $this->pullRequestId,
diff --git a/app/Livewire/Boarding/Index.php b/app/Livewire/Boarding/Index.php
index 170f0cdea..33c75bf70 100644
--- a/app/Livewire/Boarding/Index.php
+++ b/app/Livewire/Boarding/Index.php
@@ -441,7 +441,7 @@ public function selectExistingProject()
public function createNewProject()
{
- $this->createdProject = Project::forceCreate([
+ $this->createdProject = Project::create([
'name' => 'My first project',
'team_id' => currentTeam()->id,
'uuid' => (string) new Cuid2,
diff --git a/app/Livewire/Destination/New/Docker.php b/app/Livewire/Destination/New/Docker.php
index 141235590..6f9b6f995 100644
--- a/app/Livewire/Destination/New/Docker.php
+++ b/app/Livewire/Destination/New/Docker.php
@@ -77,7 +77,7 @@ public function submit()
if ($found) {
throw new \Exception('Network already added to this server.');
} else {
- $docker = SwarmDocker::forceCreate([
+ $docker = SwarmDocker::create([
'name' => $this->name,
'network' => $this->network,
'server_id' => $this->selectedServer->id,
@@ -88,7 +88,7 @@ public function submit()
if ($found) {
throw new \Exception('Network already added to this server.');
} else {
- $docker = StandaloneDocker::forceCreate([
+ $docker = StandaloneDocker::create([
'name' => $this->name,
'network' => $this->network,
'server_id' => $this->selectedServer->id,
diff --git a/app/Livewire/ForcePasswordReset.php b/app/Livewire/ForcePasswordReset.php
index 61a2a20e9..e6392497f 100644
--- a/app/Livewire/ForcePasswordReset.php
+++ b/app/Livewire/ForcePasswordReset.php
@@ -48,7 +48,7 @@ public function submit()
$this->rateLimit(10);
$this->validate();
$firstLogin = auth()->user()->created_at == auth()->user()->updated_at;
- auth()->user()->forceFill([
+ auth()->user()->fill([
'password' => Hash::make($this->password),
'force_password_reset' => false,
])->save();
diff --git a/app/Livewire/Project/AddEmpty.php b/app/Livewire/Project/AddEmpty.php
index a2581a5c9..974f0608a 100644
--- a/app/Livewire/Project/AddEmpty.php
+++ b/app/Livewire/Project/AddEmpty.php
@@ -30,7 +30,7 @@ public function submit()
{
try {
$this->validate();
- $project = Project::forceCreate([
+ $project = Project::create([
'name' => $this->name,
'description' => $this->description,
'team_id' => currentTeam()->id,
diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php
index c61a4e4a7..c887e9b83 100644
--- a/app/Livewire/Project/Application/Previews.php
+++ b/app/Livewire/Project/Application/Previews.php
@@ -196,7 +196,7 @@ public function add(int $pull_request_id, ?string $pull_request_html_url = null,
$this->setDeploymentUuid();
$found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found && ! is_null($pull_request_html_url)) {
- $found = ApplicationPreview::forceCreate([
+ $found = ApplicationPreview::create([
'application_id' => $this->application->id,
'pull_request_id' => $pull_request_id,
'pull_request_html_url' => $pull_request_html_url,
@@ -210,7 +210,7 @@ public function add(int $pull_request_id, ?string $pull_request_html_url = null,
$this->setDeploymentUuid();
$found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found && (! is_null($pull_request_html_url) || ($this->application->build_pack === 'dockerimage' && str($docker_registry_image_tag)->isNotEmpty()))) {
- $found = ApplicationPreview::forceCreate([
+ $found = ApplicationPreview::create([
'application_id' => $this->application->id,
'pull_request_id' => $pull_request_id,
'pull_request_html_url' => $pull_request_html_url ?? '',
@@ -262,7 +262,7 @@ public function deploy(int $pull_request_id, ?string $pull_request_html_url = nu
$this->setDeploymentUuid();
$found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found && (! is_null($pull_request_html_url) || ($this->application->build_pack === 'dockerimage' && str($docker_registry_image_tag)->isNotEmpty()))) {
- $found = ApplicationPreview::forceCreate([
+ $found = ApplicationPreview::create([
'application_id' => $this->application->id,
'pull_request_id' => $pull_request_id,
'pull_request_html_url' => $pull_request_html_url ?? '',
diff --git a/app/Livewire/Project/CloneMe.php b/app/Livewire/Project/CloneMe.php
index 93eb2a78c..644753c83 100644
--- a/app/Livewire/Project/CloneMe.php
+++ b/app/Livewire/Project/CloneMe.php
@@ -100,7 +100,7 @@ public function clone(string $type)
if ($foundProject) {
throw new \Exception('Project with the same name already exists.');
}
- $project = Project::forceCreate([
+ $project = Project::create([
'name' => $this->newName,
'team_id' => currentTeam()->id,
'description' => $this->project->description.' (clone)',
@@ -139,7 +139,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'status' => 'exited',
'started_at' => null,
@@ -188,7 +188,7 @@ public function clone(string $type)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $newDatabase->id,
]);
@@ -217,7 +217,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resource_id' => $newDatabase->id,
]);
$newStorage->save();
@@ -230,7 +230,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'database_id' => $newDatabase->id,
'database_type' => $newDatabase->getMorphClass(),
@@ -248,7 +248,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill($payload);
+ ])->fill($payload);
$newEnvironmentVariable->save();
}
}
@@ -259,7 +259,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'environment_id' => $environment->id,
'destination_id' => $this->selectedDestination,
@@ -277,7 +277,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => (string) new Cuid2,
'service_id' => $newService->id,
'team_id' => currentTeam()->id,
@@ -291,7 +291,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resourceable_id' => $newService->id,
'resourceable_type' => $newService->getMorphClass(),
]);
@@ -299,7 +299,7 @@ public function clone(string $type)
}
foreach ($newService->applications() as $application) {
- $application->forceFill([
+ $application->fill([
'status' => 'exited',
])->save();
@@ -317,7 +317,7 @@ public function clone(string $type)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $application->id,
]);
@@ -346,7 +346,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resource_id' => $application->id,
]);
$newStorage->save();
@@ -354,7 +354,7 @@ public function clone(string $type)
}
foreach ($newService->databases() as $database) {
- $database->forceFill([
+ $database->fill([
'status' => 'exited',
])->save();
@@ -372,7 +372,7 @@ public function clone(string $type)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $database->id,
]);
@@ -401,7 +401,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resource_id' => $database->id,
]);
$newStorage->save();
@@ -414,7 +414,7 @@ public function clone(string $type)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'database_id' => $database->id,
'database_type' => $database->getMorphClass(),
diff --git a/app/Livewire/Project/New/DockerCompose.php b/app/Livewire/Project/New/DockerCompose.php
index 99fb2efc4..2b92902c6 100644
--- a/app/Livewire/Project/New/DockerCompose.php
+++ b/app/Livewire/Project/New/DockerCompose.php
@@ -54,7 +54,7 @@ public function submit()
}
$destination_class = $destination->getMorphClass();
- $service = Service::forceCreate([
+ $service = Service::create([
'docker_compose_raw' => $this->dockerComposeRaw,
'environment_id' => $environment->id,
'server_id' => (int) $server_id,
diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.php
index 8becdf585..268333d07 100644
--- a/app/Livewire/Project/New/DockerImage.php
+++ b/app/Livewire/Project/New/DockerImage.php
@@ -133,7 +133,7 @@ public function submit()
// Determine the image tag based on whether it's a hash or regular tag
$imageTag = $parser->isImageHash() ? 'sha256-'.$parser->getTag() : $parser->getTag();
- $application = Application::forceCreate([
+ $application = Application::create([
'name' => 'docker-image-'.new Cuid2,
'repository_project_id' => 0,
'git_repository' => 'coollabsio/coolify',
diff --git a/app/Livewire/Project/New/EmptyProject.php b/app/Livewire/Project/New/EmptyProject.php
index 1cdc7e098..0360365a9 100644
--- a/app/Livewire/Project/New/EmptyProject.php
+++ b/app/Livewire/Project/New/EmptyProject.php
@@ -10,7 +10,7 @@ class EmptyProject extends Component
{
public function createEmptyProject()
{
- $project = Project::forceCreate([
+ $project = Project::create([
'name' => generate_random_name(),
'team_id' => currentTeam()->id,
'uuid' => (string) new Cuid2,
diff --git a/app/Livewire/Project/New/GithubPrivateRepository.php b/app/Livewire/Project/New/GithubPrivateRepository.php
index 6aa8db085..0222008b0 100644
--- a/app/Livewire/Project/New/GithubPrivateRepository.php
+++ b/app/Livewire/Project/New/GithubPrivateRepository.php
@@ -99,6 +99,8 @@ public function updatedBuildPack()
public function loadRepositories($github_app_id)
{
$this->repositories = collect();
+ $this->branches = collect();
+ $this->total_branches_count = 0;
$this->page = 1;
$this->selected_github_app_id = $github_app_id;
$this->github_app = GithubApp::where('id', $github_app_id)->first();
@@ -189,7 +191,7 @@ public function submit()
$project = Project::ownedByCurrentTeam()->where('uuid', $this->parameters['project_uuid'])->firstOrFail();
$environment = $project->environments()->where('uuid', $this->parameters['environment_uuid'])->firstOrFail();
- $application = Application::forceCreate([
+ $application = Application::create([
'name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),
'repository_project_id' => $this->selected_repository_id,
'git_repository' => str($this->selected_repository_owner)->trim()->toString().'/'.str($this->selected_repository_repo)->trim()->toString(),
diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
index ba058c6ff..f8642d6fc 100644
--- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
+++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
@@ -183,7 +183,7 @@ public function submit()
$application_init['docker_compose_location'] = $this->docker_compose_location;
$application_init['base_directory'] = $this->base_directory;
}
- $application = Application::forceCreate($application_init);
+ $application = Application::create($application_init);
$application->settings->is_static = $this->is_static;
$application->settings->save();
diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php
index 6bd71d246..62ac7ec0d 100644
--- a/app/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Livewire/Project/New/PublicGitRepository.php
@@ -299,7 +299,7 @@ public function submit()
$new_service['source_id'] = $this->git_source->id;
$new_service['source_type'] = $this->git_source->getMorphClass();
}
- $service = Service::forceCreate($new_service);
+ $service = Service::create($new_service);
return redirect()->route('project.service.configuration', [
'service_uuid' => $service->uuid,
@@ -346,7 +346,7 @@ public function submit()
$application_init['docker_compose_location'] = $this->docker_compose_location;
$application_init['base_directory'] = $this->base_directory;
}
- $application = Application::forceCreate($application_init);
+ $application = Application::create($application_init);
$application->settings->is_static = $this->isStatic;
$application->settings->save();
diff --git a/app/Livewire/Project/New/SimpleDockerfile.php b/app/Livewire/Project/New/SimpleDockerfile.php
index 400b58fea..1073157e6 100644
--- a/app/Livewire/Project/New/SimpleDockerfile.php
+++ b/app/Livewire/Project/New/SimpleDockerfile.php
@@ -52,7 +52,7 @@ public function submit()
if (! $port) {
$port = 80;
}
- $application = Application::forceCreate([
+ $application = Application::create([
'name' => 'dockerfile-'.new Cuid2,
'repository_project_id' => 0,
'git_repository' => 'coollabsio/coolify',
diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php
index dbe56b079..966c66a14 100644
--- a/app/Livewire/Project/Resource/Create.php
+++ b/app/Livewire/Project/Resource/Create.php
@@ -91,7 +91,7 @@ public function mount()
if (in_array($oneClickServiceName, NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK)) {
data_set($service_payload, 'connect_to_docker_network', true);
}
- $service = Service::forceCreate($service_payload);
+ $service = Service::create($service_payload);
$service->name = "$oneClickServiceName-".$service->uuid;
$service->save();
if ($oneClickDotEnvs?->count() > 0) {
diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.php
index 301c51be9..f4813dd4c 100644
--- a/app/Livewire/Project/Shared/ResourceOperations.php
+++ b/app/Livewire/Project/Shared/ResourceOperations.php
@@ -94,7 +94,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'name' => $this->resource->name.'-clone-'.$uuid,
'status' => 'exited',
@@ -143,7 +143,7 @@ public function cloneTo($destination_id)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $new_resource->id,
]);
@@ -172,7 +172,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resource_id' => $new_resource->id,
]);
$newStorage->save();
@@ -185,7 +185,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'database_id' => $new_resource->id,
'database_type' => $new_resource->getMorphClass(),
@@ -204,7 +204,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill($payload);
+ ])->fill($payload);
$newEnvironmentVariable->save();
}
@@ -221,7 +221,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => $uuid,
'name' => $this->resource->name.'-clone-'.$uuid,
'destination_id' => $new_destination->id,
@@ -242,7 +242,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => (string) new Cuid2,
'service_id' => $new_resource->id,
'team_id' => currentTeam()->id,
@@ -256,7 +256,7 @@ public function cloneTo($destination_id)
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resourceable_id' => $new_resource->id,
'resourceable_type' => $new_resource->getMorphClass(),
]);
@@ -264,7 +264,7 @@ public function cloneTo($destination_id)
}
foreach ($new_resource->applications() as $application) {
- $application->forceFill([
+ $application->fill([
'status' => 'exited',
])->save();
@@ -282,7 +282,7 @@ public function cloneTo($destination_id)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $application->id,
]);
@@ -307,7 +307,7 @@ public function cloneTo($destination_id)
}
foreach ($new_resource->databases() as $database) {
- $database->forceFill([
+ $database->fill([
'status' => 'exited',
])->save();
@@ -325,7 +325,7 @@ public function cloneTo($destination_id)
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $database->id,
]);
@@ -366,7 +366,7 @@ public function moveTo($environment_id)
try {
$this->authorize('update', $this->resource);
$new_environment = Environment::ownedByCurrentTeam()->findOrFail($environment_id);
- $this->resource->forceFill([
+ $this->resource->fill([
'environment_id' => $environment_id,
])->save();
if ($this->resource->type() === 'application') {
diff --git a/app/Livewire/Project/Show.php b/app/Livewire/Project/Show.php
index b9628dd0d..e884abb4e 100644
--- a/app/Livewire/Project/Show.php
+++ b/app/Livewire/Project/Show.php
@@ -42,7 +42,7 @@ public function submit()
{
try {
$this->validate();
- $environment = Environment::forceCreate([
+ $environment = Environment::create([
'name' => $this->name,
'project_id' => $this->project->id,
'uuid' => (string) new Cuid2,
diff --git a/app/Livewire/Server/Destinations.php b/app/Livewire/Server/Destinations.php
index f41ca00f3..117b43ad6 100644
--- a/app/Livewire/Server/Destinations.php
+++ b/app/Livewire/Server/Destinations.php
@@ -43,7 +43,7 @@ public function add($name)
return;
} else {
- SwarmDocker::forceCreate([
+ SwarmDocker::create([
'name' => $this->server->name.'-'.$name,
'network' => $this->name,
'server_id' => $this->server->id,
@@ -57,7 +57,7 @@ public function add($name)
return;
} else {
- StandaloneDocker::forceCreate([
+ StandaloneDocker::create([
'name' => $this->server->name.'-'.$name,
'network' => $name,
'server_id' => $this->server->id,
diff --git a/app/Livewire/SettingsBackup.php b/app/Livewire/SettingsBackup.php
index a111a6096..5336c0c9a 100644
--- a/app/Livewire/SettingsBackup.php
+++ b/app/Livewire/SettingsBackup.php
@@ -83,7 +83,8 @@ public function addCoolifyDatabase()
$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 @@ public function addCoolifyDatabase()
'destination_type' => StandaloneDocker::class,
'destination_id' => 0,
]);
+ $this->database->save();
$this->backup = ScheduledDatabaseBackup::create([
'id' => 0,
'enabled' => true,
diff --git a/app/Models/Application.php b/app/Models/Application.php
index bdc76eb33..fef6f6e4c 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -203,6 +203,14 @@ class Application extends BaseModel
'restart_count',
'last_restart_at',
'last_restart_type',
+ 'uuid',
+ 'environment_id',
+ 'destination_id',
+ 'destination_type',
+ 'source_id',
+ 'source_type',
+ 'repository_project_id',
+ 'private_key_id',
];
protected $appends = ['server_status'];
@@ -262,7 +270,7 @@ protected static function booted()
}
}
if (count($payload) > 0) {
- $application->forceFill($payload);
+ $application->fill($payload);
}
// Buildpack switching cleanup logic
@@ -299,7 +307,7 @@ protected static function booted()
}
});
static::created(function ($application) {
- ApplicationSetting::forceCreate([
+ ApplicationSetting::create([
'application_id' => $application->id,
]);
$application->compose_parsing_version = self::$parserVersion;
diff --git a/app/Models/ApplicationDeploymentQueue.php b/app/Models/ApplicationDeploymentQueue.php
index 21cb58abe..67f28523c 100644
--- a/app/Models/ApplicationDeploymentQueue.php
+++ b/app/Models/ApplicationDeploymentQueue.php
@@ -44,6 +44,7 @@ class ApplicationDeploymentQueue extends Model
'application_id',
'deployment_uuid',
'pull_request_id',
+ 'docker_registry_image_tag',
'force_rebuild',
'commit',
'status',
diff --git a/app/Models/ApplicationPreview.php b/app/Models/ApplicationPreview.php
index 818f96d8e..f08a48cea 100644
--- a/app/Models/ApplicationPreview.php
+++ b/app/Models/ApplicationPreview.php
@@ -11,6 +11,7 @@ class ApplicationPreview extends BaseModel
use SoftDeletes;
protected $fillable = [
+ 'uuid',
'application_id',
'pull_request_id',
'pull_request_html_url',
@@ -62,7 +63,7 @@ protected static function booted()
});
static::saving(function ($preview) {
if ($preview->isDirty('status')) {
- $preview->forceFill(['last_online_at' => now()]);
+ $preview->last_online_at = now();
}
});
}
diff --git a/app/Models/ApplicationSetting.php b/app/Models/ApplicationSetting.php
index 24b35df7f..731a9b5da 100644
--- a/app/Models/ApplicationSetting.php
+++ b/app/Models/ApplicationSetting.php
@@ -29,6 +29,7 @@ class ApplicationSetting extends Model
];
protected $fillable = [
+ 'application_id',
'is_static',
'is_git_submodules_enabled',
'is_git_lfs_enabled',
diff --git a/app/Models/CloudProviderToken.php b/app/Models/CloudProviderToken.php
index 123376c9b..026d11fba 100644
--- a/app/Models/CloudProviderToken.php
+++ b/app/Models/CloudProviderToken.php
@@ -5,6 +5,7 @@
class CloudProviderToken extends BaseModel
{
protected $fillable = [
+ 'team_id',
'provider',
'token',
'name',
diff --git a/app/Models/Environment.php b/app/Models/Environment.php
index 7fb4e8693..55830f889 100644
--- a/app/Models/Environment.php
+++ b/app/Models/Environment.php
@@ -28,6 +28,8 @@ class Environment extends BaseModel
protected $fillable = [
'name',
'description',
+ 'project_id',
+ 'uuid',
];
protected static function booted()
diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php
index 3cffeb8f8..54bbb3f7d 100644
--- a/app/Models/GithubApp.php
+++ b/app/Models/GithubApp.php
@@ -7,6 +7,8 @@
class GithubApp extends BaseModel
{
protected $fillable = [
+ 'team_id',
+ 'private_key_id',
'name',
'organization',
'api_url',
diff --git a/app/Models/Project.php b/app/Models/Project.php
index bc2929a79..632787a07 100644
--- a/app/Models/Project.php
+++ b/app/Models/Project.php
@@ -27,6 +27,8 @@ class Project extends BaseModel
protected $fillable = [
'name',
'description',
+ 'team_id',
+ 'uuid',
];
/**
@@ -51,10 +53,10 @@ public static function ownedByCurrentTeamCached()
protected static function booted()
{
static::created(function ($project) {
- ProjectSetting::forceCreate([
+ ProjectSetting::create([
'project_id' => $project->id,
]);
- Environment::forceCreate([
+ Environment::create([
'name' => 'production',
'project_id' => $project->id,
'uuid' => (string) new Cuid2,
diff --git a/app/Models/ProjectSetting.php b/app/Models/ProjectSetting.php
index 7ea17ba7a..8b59ffac6 100644
--- a/app/Models/ProjectSetting.php
+++ b/app/Models/ProjectSetting.php
@@ -6,7 +6,9 @@
class ProjectSetting extends Model
{
- protected $fillable = [];
+ protected $fillable = [
+ 'project_id',
+ ];
public function project()
{
diff --git a/app/Models/ScheduledDatabaseBackup.php b/app/Models/ScheduledDatabaseBackup.php
index c6aed863d..6308bae8b 100644
--- a/app/Models/ScheduledDatabaseBackup.php
+++ b/app/Models/ScheduledDatabaseBackup.php
@@ -9,6 +9,8 @@
class ScheduledDatabaseBackup extends BaseModel
{
protected $fillable = [
+ 'uuid',
+ 'team_id',
'description',
'enabled',
'save_s3',
diff --git a/app/Models/ScheduledDatabaseBackupExecution.php b/app/Models/ScheduledDatabaseBackupExecution.php
index f1f6e88b5..51ad46de9 100644
--- a/app/Models/ScheduledDatabaseBackupExecution.php
+++ b/app/Models/ScheduledDatabaseBackupExecution.php
@@ -7,6 +7,8 @@
class ScheduledDatabaseBackupExecution extends BaseModel
{
protected $fillable = [
+ 'uuid',
+ 'scheduled_database_backup_id',
'status',
'message',
'size',
diff --git a/app/Models/ScheduledTask.php b/app/Models/ScheduledTask.php
index e76f1b7b9..40f8e1860 100644
--- a/app/Models/ScheduledTask.php
+++ b/app/Models/ScheduledTask.php
@@ -30,12 +30,16 @@ class ScheduledTask extends BaseModel
use HasSafeStringAttribute;
protected $fillable = [
+ 'uuid',
'enabled',
'name',
'command',
'frequency',
'container',
'timeout',
+ 'team_id',
+ 'application_id',
+ 'service_id',
];
public static function ownedByCurrentTeamAPI(int $teamId)
diff --git a/app/Models/ScheduledTaskExecution.php b/app/Models/ScheduledTaskExecution.php
index dd74ba2e0..1e26c7be3 100644
--- a/app/Models/ScheduledTaskExecution.php
+++ b/app/Models/ScheduledTaskExecution.php
@@ -23,6 +23,7 @@
class ScheduledTaskExecution extends BaseModel
{
protected $fillable = [
+ 'scheduled_task_id',
'status',
'message',
'finished_at',
diff --git a/app/Models/Server.php b/app/Models/Server.php
index 3f720a2b3..6b59654ef 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -135,7 +135,7 @@ protected static function booted()
$payload['ip_previous'] = $server->getOriginal('ip');
}
}
- $server->forceFill($payload);
+ $server->fill($payload);
});
static::saved(function ($server) {
if ($server->wasChanged('private_key_id') || $server->privateKey?->isDirty()) {
@@ -143,28 +143,28 @@ protected static function booted()
}
});
static::created(function ($server) {
- ServerSetting::forceCreate([
+ ServerSetting::create([
'server_id' => $server->id,
]);
if ($server->id === 0) {
if ($server->isSwarm()) {
- SwarmDocker::forceCreate([
+ (new SwarmDocker)->forceFill([
'id' => 0,
'name' => 'coolify',
'network' => 'coolify-overlay',
'server_id' => $server->id,
- ]);
+ ])->save();
} else {
- StandaloneDocker::forceCreate([
+ (new StandaloneDocker)->forceFill([
'id' => 0,
'name' => 'coolify',
'network' => 'coolify',
'server_id' => $server->id,
- ]);
+ ])->saveQuietly();
}
} else {
if ($server->isSwarm()) {
- SwarmDocker::forceCreate([
+ SwarmDocker::create([
'name' => 'coolify-overlay',
'network' => 'coolify-overlay',
'server_id' => $server->id,
@@ -283,6 +283,7 @@ public static function flushIdentityMap(): void
'detected_traefik_version',
'traefik_outdated_info',
'server_metadata',
+ 'ip_previous',
];
use HasSafeStringAttribute;
diff --git a/app/Models/ServerSetting.php b/app/Models/ServerSetting.php
index d34f2c86b..30fc1e165 100644
--- a/app/Models/ServerSetting.php
+++ b/app/Models/ServerSetting.php
@@ -54,6 +54,7 @@
class ServerSetting extends Model
{
protected $fillable = [
+ 'server_id',
'is_swarm_manager',
'is_jump_server',
'is_build_server',
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 491924c49..11189b4ac 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -49,6 +49,7 @@ class Service extends BaseModel
private static $parserVersion = '5';
protected $fillable = [
+ 'uuid',
'name',
'description',
'docker_compose_raw',
@@ -58,6 +59,10 @@ class Service extends BaseModel
'config_hash',
'compose_parsing_version',
'is_container_label_escape_enabled',
+ 'environment_id',
+ 'server_id',
+ 'destination_id',
+ 'destination_type',
];
protected $appends = ['server_status', 'status'];
diff --git a/app/Models/ServiceApplication.php b/app/Models/ServiceApplication.php
index e608c202d..6bf12f4e7 100644
--- a/app/Models/ServiceApplication.php
+++ b/app/Models/ServiceApplication.php
@@ -12,6 +12,7 @@ class ServiceApplication extends BaseModel
use HasFactory, SoftDeletes;
protected $fillable = [
+ 'service_id',
'name',
'human_name',
'description',
@@ -39,7 +40,7 @@ protected static function booted()
});
static::saving(function ($service) {
if ($service->isDirty('status')) {
- $service->forceFill(['last_online_at' => now()]);
+ $service->last_online_at = now();
}
});
}
diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.php
index e5b28d929..69801f985 100644
--- a/app/Models/ServiceDatabase.php
+++ b/app/Models/ServiceDatabase.php
@@ -10,6 +10,7 @@ class ServiceDatabase extends BaseModel
use HasFactory, SoftDeletes;
protected $fillable = [
+ 'service_id',
'name',
'human_name',
'description',
@@ -44,7 +45,7 @@ protected static function booted()
});
static::saving(function ($service) {
if ($service->isDirty('status')) {
- $service->forceFill(['last_online_at' => now()]);
+ $service->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneClickhouse.php b/app/Models/StandaloneClickhouse.php
index c6d91dd55..784e2c937 100644
--- a/app/Models/StandaloneClickhouse.php
+++ b/app/Models/StandaloneClickhouse.php
@@ -14,6 +14,7 @@ class StandaloneClickhouse extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'clickhouse_admin_user',
@@ -40,6 +41,9 @@ class StandaloneClickhouse extends BaseModel
'public_port_timeout',
'custom_docker_run_options',
'clickhouse_db',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -71,7 +75,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneDocker.php b/app/Models/StandaloneDocker.php
index 09dae022b..dcb349405 100644
--- a/app/Models/StandaloneDocker.php
+++ b/app/Models/StandaloneDocker.php
@@ -13,6 +13,7 @@ class StandaloneDocker extends BaseModel
use HasSafeStringAttribute;
protected $fillable = [
+ 'server_id',
'name',
'network',
];
diff --git a/app/Models/StandaloneDragonfly.php b/app/Models/StandaloneDragonfly.php
index af309f980..e07053c03 100644
--- a/app/Models/StandaloneDragonfly.php
+++ b/app/Models/StandaloneDragonfly.php
@@ -14,6 +14,7 @@ class StandaloneDragonfly extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'dragonfly_password',
@@ -39,6 +40,9 @@ class StandaloneDragonfly extends BaseModel
'public_port_timeout',
'enable_ssl',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -70,7 +74,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneKeydb.php b/app/Models/StandaloneKeydb.php
index ee07b4783..979f45a3d 100644
--- a/app/Models/StandaloneKeydb.php
+++ b/app/Models/StandaloneKeydb.php
@@ -14,6 +14,7 @@ class StandaloneKeydb extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'keydb_password',
@@ -40,6 +41,9 @@ class StandaloneKeydb extends BaseModel
'public_port_timeout',
'enable_ssl',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'server_status'];
@@ -71,7 +75,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.php
index ad5220496..dba8a52f5 100644
--- a/app/Models/StandaloneMariadb.php
+++ b/app/Models/StandaloneMariadb.php
@@ -15,6 +15,7 @@ class StandaloneMariadb extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'mariadb_root_password',
@@ -43,6 +44,9 @@ class StandaloneMariadb extends BaseModel
'enable_ssl',
'is_log_drain_enabled',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -74,7 +78,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.php
index 590c173e1..e72f4f1c6 100644
--- a/app/Models/StandaloneMongodb.php
+++ b/app/Models/StandaloneMongodb.php
@@ -14,6 +14,7 @@ class StandaloneMongodb extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'mongo_conf',
@@ -43,6 +44,9 @@ class StandaloneMongodb extends BaseModel
'is_log_drain_enabled',
'is_include_timestamps',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -80,7 +84,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.php
index d991617b7..1c522d200 100644
--- a/app/Models/StandaloneMysql.php
+++ b/app/Models/StandaloneMysql.php
@@ -14,6 +14,7 @@ class StandaloneMysql extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'mysql_root_password',
@@ -44,6 +45,9 @@ class StandaloneMysql extends BaseModel
'is_log_drain_enabled',
'is_include_timestamps',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -76,7 +80,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php
index 71034427f..57dfe5988 100644
--- a/app/Models/StandalonePostgresql.php
+++ b/app/Models/StandalonePostgresql.php
@@ -14,6 +14,7 @@ class StandalonePostgresql extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'postgres_user',
@@ -46,6 +47,9 @@ class StandalonePostgresql extends BaseModel
'is_log_drain_enabled',
'is_include_timestamps',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -92,7 +96,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
}
diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.php
index 4eb28e038..ef42d7f18 100644
--- a/app/Models/StandaloneRedis.php
+++ b/app/Models/StandaloneRedis.php
@@ -14,6 +14,7 @@ class StandaloneRedis extends BaseModel
use ClearsGlobalSearchCache, HasFactory, HasMetrics, HasSafeStringAttribute, SoftDeletes;
protected $fillable = [
+ 'uuid',
'name',
'description',
'redis_conf',
@@ -39,6 +40,9 @@ class StandaloneRedis extends BaseModel
'is_log_drain_enabled',
'is_include_timestamps',
'custom_docker_run_options',
+ 'destination_type',
+ 'destination_id',
+ 'environment_id',
];
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
@@ -69,7 +73,7 @@ protected static function booted()
});
static::saving(function ($database) {
if ($database->isDirty('status')) {
- $database->forceFill(['last_online_at' => now()]);
+ $database->last_online_at = now();
}
});
diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php
index fa135b29f..b0fec64f9 100644
--- a/app/Models/Subscription.php
+++ b/app/Models/Subscription.php
@@ -7,6 +7,7 @@
class Subscription extends Model
{
protected $fillable = [
+ 'team_id',
'stripe_invoice_paid',
'stripe_subscription_id',
'stripe_customer_id',
diff --git a/app/Models/SwarmDocker.php b/app/Models/SwarmDocker.php
index 656749119..134e36189 100644
--- a/app/Models/SwarmDocker.php
+++ b/app/Models/SwarmDocker.php
@@ -7,6 +7,7 @@
class SwarmDocker extends BaseModel
{
protected $fillable = [
+ 'server_id',
'name',
'network',
];
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index 9ee58cf7d..e6fbd3a06 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -10,6 +10,7 @@ class Tag extends BaseModel
protected $fillable = [
'name',
+ 'team_id',
];
protected function customizeName($value)
diff --git a/app/Models/User.php b/app/Models/User.php
index ad9a7af31..3199d2024 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -49,6 +49,9 @@ class User extends Authenticatable implements SendsEmail
'password',
'force_password_reset',
'marketing_emails',
+ 'pending_email',
+ 'email_change_code',
+ 'email_change_code_expires_at',
];
protected $hidden = [
@@ -95,7 +98,8 @@ protected static function boot()
$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']);
});
@@ -198,7 +202,8 @@ public function recreate_personal_team()
$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;
@@ -409,7 +414,7 @@ public function requestEmailChange(string $newEmail): void
$expiryMinutes = config('constants.email_change.verification_code_expiry_minutes', 10);
$expiresAt = Carbon::now()->addMinutes($expiryMinutes);
- $this->forceFill([
+ $this->fill([
'pending_email' => $newEmail,
'email_change_code' => $code,
'email_change_code_expires_at' => $expiresAt,
diff --git a/bootstrap/helpers/applications.php b/bootstrap/helpers/applications.php
index e4feec692..48e0a8c78 100644
--- a/bootstrap/helpers/applications.php
+++ b/bootstrap/helpers/applications.php
@@ -214,7 +214,7 @@ function clone_application(Application $source, $destination, array $overrides =
'updated_at',
'additional_servers_count',
'additional_networks_count',
- ])->forceFill(array_merge([
+ ])->fill(array_merge([
'uuid' => $uuid,
'name' => $name,
'fqdn' => $url,
@@ -237,7 +237,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'application_id' => $newApplication->id,
]);
$newApplicationSettings->save();
@@ -257,7 +257,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => (string) new Cuid2,
'application_id' => $newApplication->id,
'team_id' => currentTeam()->id,
@@ -272,7 +272,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'uuid' => (string) new Cuid2,
'application_id' => $newApplication->id,
'status' => 'exited',
@@ -304,7 +304,7 @@ function clone_application(Application $source, $destination, array $overrides =
'created_at',
'updated_at',
'uuid',
- ])->forceFill([
+ ])->fill([
'name' => $newName,
'resource_id' => $newApplication->id,
]);
@@ -340,7 +340,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resource_id' => $newApplication->id,
]);
$newStorage->save();
@@ -354,7 +354,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resourceable_id' => $newApplication->id,
'resourceable_type' => $newApplication->getMorphClass(),
'is_preview' => false,
@@ -371,7 +371,7 @@ function clone_application(Application $source, $destination, array $overrides =
'id',
'created_at',
'updated_at',
- ])->forceFill([
+ ])->fill([
'resourceable_id' => $newApplication->id,
'resourceable_type' => $newApplication->getMorphClass(),
'is_preview' => true,
diff --git a/bootstrap/helpers/parsers.php b/bootstrap/helpers/parsers.php
index 751851283..123cf906a 100644
--- a/bootstrap/helpers/parsers.php
+++ b/bootstrap/helpers/parsers.php
@@ -1597,7 +1597,7 @@ function serviceParser(Service $resource): Collection
if ($databaseFound) {
$savedService = $databaseFound;
} else {
- $savedService = ServiceDatabase::forceCreate([
+ $savedService = ServiceDatabase::create([
'name' => $serviceName,
'service_id' => $resource->id,
]);
@@ -1607,7 +1607,7 @@ function serviceParser(Service $resource): Collection
if ($applicationFound) {
$savedService = $applicationFound;
} else {
- $savedService = ServiceApplication::forceCreate([
+ $savedService = ServiceApplication::create([
'name' => $serviceName,
'service_id' => $resource->id,
]);
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index a43f2e340..cd773f6a9 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -1919,7 +1919,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
// Create new serviceApplication or serviceDatabase
if ($isDatabase) {
if ($isNew) {
- $savedService = ServiceDatabase::forceCreate([
+ $savedService = ServiceDatabase::create([
'name' => $serviceName,
'image' => $image,
'service_id' => $resource->id,
@@ -1930,7 +1930,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'service_id' => $resource->id,
])->first();
if (is_null($savedService)) {
- $savedService = ServiceDatabase::forceCreate([
+ $savedService = ServiceDatabase::create([
'name' => $serviceName,
'image' => $image,
'service_id' => $resource->id,
@@ -1939,7 +1939,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
}
} else {
if ($isNew) {
- $savedService = ServiceApplication::forceCreate([
+ $savedService = ServiceApplication::create([
'name' => $serviceName,
'image' => $image,
'service_id' => $resource->id,
@@ -1950,7 +1950,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'service_id' => $resource->id,
])->first();
if (is_null($savedService)) {
- $savedService = ServiceApplication::forceCreate([
+ $savedService = ServiceApplication::create([
'name' => $serviceName,
'image' => $image,
'service_id' => $resource->id,
diff --git a/resources/views/livewire/project/new/github-private-repository.blade.php b/resources/views/livewire/project/new/github-private-repository.blade.php
index 129c508a9..ec0d17506 100644
--- a/resources/views/livewire/project/new/github-private-repository.blade.php
+++ b/resources/views/livewire/project/new/github-private-repository.blade.php
@@ -5,11 +5,13 @@