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 check if IP is already in used in this team

peaklabs-dev465dfbdf530b
diff --git a/app/Livewire/Server/Show.php b/app/Livewire/Server/Show.php
index 5a1743f960..a5544489dd 100644
--- a/app/Livewire/Server/Show.php
+++ b/app/Livewire/Server/Show.php
@@ -107,6 +107,15 @@ class Show extends Component
{
if ($toModel) {
$this->validate();
+
+ if (Server::where('team_id', currentTeam()->id)
+ ->where('ip', $this->ip)
+ ->where('id', '!=', $this->server->id)
+ ->exists()) {
+ $this->ip = $this->server->ip;
+ throw new \Exception('This IP/Domain is already in use by another server in your team.');
+ }
+
$this->server->name = $this->name;
$this->server->description = $this->description;
$this->server->ip = $this->ip;