lasthourcloud/app/Http/Livewire/Project/Application/Storages/Show.php

31 lines
675 B
PHP
Raw Normal View History

2023-05-05 10:08:38 +00:00
<?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',
];
2023-06-16 10:35:40 +00:00
protected $validationAttributes = [
'name' => 'name',
'mount_path' => 'mount',
'host_path' => 'host',
];
2023-05-05 10:08:38 +00:00
public function submit()
{
$this->validate();
$this->storage->save();
}
public function delete()
{
$this->storage->delete();
$this->emit('refreshStorages');
}
}