fix check if IP is already in used in this team
This commit is contained in:
parent
ca4b91c51f
commit
465dfbdf53
1 changed files with 9 additions and 0 deletions
|
|
@ -107,6 +107,15 @@ public function syncData(bool $toModel = false)
|
||||||
{
|
{
|
||||||
if ($toModel) {
|
if ($toModel) {
|
||||||
$this->validate();
|
$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->name = $this->name;
|
||||||
$this->server->description = $this->description;
|
$this->server->description = $this->description;
|
||||||
$this->server->ip = $this->ip;
|
$this->server->ip = $this->ip;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue