Refactor Docker-related code and add conditional rendering

This commit is contained in:
Andras Bacsai
2024-03-25 13:10:05 +01:00
parent 3de4f2805a
commit bcbdee1dcc
4 changed files with 21 additions and 13 deletions

View File

@@ -49,7 +49,9 @@ class Docker extends Component
} else {
$this->network = new Cuid2(7);
}
$this->name = str("{$this->servers->first()->name}-{$this->network}")->kebab();
if ($this->servers->count() > 0) {
$this->name = str("{$this->servers->first()->name}-{$this->network}")->kebab();
}
}
public function generate_name()