lasthourcloud/app/Http/Livewire/Project/Service/ComposeModal.php
Andras Bacsai ceedd5225f modal fix?
2023-12-06 15:50:13 +01:00

30 lines
769 B
PHP

<?php
namespace App\Http\Livewire\Project\Service;
use App\Models\Service;
use Livewire\Component;
use LivewireUI\Modal\ModalComponent;
class ComposeModal extends ModalComponent
{
public Service $service;
public $serviceId;
protected $rules = [
'service.docker_compose_raw' => 'required',
'service.docker_compose' => 'required',
];
public function mount() {
$this->service = Service::find($this->serviceId);
}
public function render()
{
return view('livewire.project.service.compose-modal');
}
public function submit() {
$this->emit('warning', "Saving new docker compose...");
$this->emit('saveCompose', $this->service->docker_compose_raw);
$this->closeModal();
}
}