coolify/app/Http/Livewire/Project/Application/Storages/Show.php
Andras Bacsai 3589b92ec9 fix
2023-06-16 12:35:40 +02:00

31 lines
675 B
PHP

<?php
namespace App\Http\Livewire\Project\Application\Storages;
use Livewire\Component;
class Show extends Component
{
public $storage;
protected $rules = [
'storage.name' => 'required|string',
'storage.mount_path' => 'required|string',
'storage.host_path' => 'string|nullable',
];
protected $validationAttributes = [
'name' => 'name',
'mount_path' => 'mount',
'host_path' => 'host',
];
public function submit()
{
$this->validate();
$this->storage->save();
}
public function delete()
{
$this->storage->delete();
$this->emit('refreshStorages');
}
}