lasthourcloud/app/Http/Livewire/Project/Application/Storages/Add.php
Andras Bacsai f79b3841c7 fixes
2023-06-15 09:15:41 +02:00

40 lines
921 B
PHP

<?php
namespace App\Http\Livewire\Project\Application\Storages;
use Livewire\Component;
class Add extends Component
{
public $parameters;
public string $name;
public string $mount_path;
public string|null $host_path = null;
protected $listeners = ['clearAddStorage' => 'clear'];
protected $rules = [
'name' => 'required|string',
'mount_path' => 'required|string',
'host_path' => 'string|nullable',
];
public function mount()
{
$this->parameters = getRouteParameters();
}
public function submit()
{
$this->validate();
$this->emitUp('submit', [
'name' => $this->name,
'mount_path' => $this->mount_path,
'host_path' => $this->host_path,
]);
}
public function clear()
{
$this->name = '';
$this->mount_path = '';
$this->host_path = null;
}
}