delete server

This commit is contained in:
Andras Bacsai
2023-05-03 10:25:44 +02:00
parent e174e2f68f
commit b69410697d
5 changed files with 34 additions and 14 deletions

View File

@@ -54,6 +54,11 @@ class Form extends Component
} catch (\Exception $e) {
}
}
public function delete()
{
$this->server->delete();
redirect()->route('dashboard');
}
public function submit()
{
$this->validate();

View File

@@ -45,6 +45,10 @@ class ByIp extends Component
}
public function submit()
{
if (!$this->private_key_id) {
$this->addError('private_key_id', 'The private key field is required.');
return;
}
$server = Server::create([
'name' => $this->name,
'description' => $this->description,