Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: sentry

Andras Bacsai37e37d1998a5
diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php
index 8491502221..c56290a06f 100644
--- a/app/Livewire/Project/New/Select.php
+++ b/app/Livewire/Project/New/Select.php
@@ -15,10 +15,10 @@ class Select extends Component
public string $type;
public string $server_id;
public string $destination_uuid;
- public Countable|array|Server $allServers = [];
- public Countable|array|Server $servers = [];
- public Collection|array $standaloneDockers = [];
- public Collection|array $swarmDockers = [];
+ public Collection|null|Server $allServers;
+ public Collection|null|Server $servers;
+ public ?Collection $standaloneDockers;
+ public ?Collection $swarmDockers;
public array $parameters;
public Collection|array $services = [];
public Collection|array $allServices = [];
@@ -107,7 +107,11 @@ class Select extends Component
if ($this->includeSwarm) {
$this->servers = $this->allServers;
} else {
- $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ if ($this->allServers instanceof Collection) {
+ $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ } else {
+ $this->servers = $this->allServers;
+ }
}
}
public function setType(string $type)
@@ -126,13 +130,21 @@ class Select extends Component
case 'mongodb':
$this->isDatabase = true;
$this->includeSwarm = false;
- $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ if ($this->allServers instanceof Collection) {
+ $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ } else {
+ $this->servers = $this->allServers;
+ }
break;
}
if (str($type)->startsWith('one-click-service') || str($type)->startsWith('docker-compose-empty')) {
$this->isDatabase = true;
$this->includeSwarm = false;
- $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ if ($this->allServers instanceof Collection) {
+ $this->servers = $this->allServers->where('settings.is_swarm_worker', false)->where('settings.is_swarm_manager', false)->where('settings.is_build_server', false);
+ } else {
+ $this->servers = $this->allServers;
+ }
}
if ($type === "existing-postgresql") {
$this->current_step = $type;