2023-09-30 13:08:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Project\Service;
|
|
|
|
|
2023-12-06 13:57:03 +00:00
|
|
|
use App\Models\Service;
|
2023-09-30 13:08:40 +00:00
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class ComposeModal extends Component
|
|
|
|
{
|
2023-12-06 13:57:03 +00:00
|
|
|
public Service $service;
|
|
|
|
protected $rules = [
|
|
|
|
'service.docker_compose_raw' => 'required',
|
|
|
|
'service.docker_compose' => 'required',
|
|
|
|
];
|
2023-09-30 13:08:40 +00:00
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.project.service.compose-modal');
|
|
|
|
}
|
|
|
|
public function submit() {
|
|
|
|
$this->emit('warning', "Saving new docker compose...");
|
2023-12-06 13:57:03 +00:00
|
|
|
$this->emit('saveCompose', $this->service->docker_compose_raw);
|
2023-09-30 13:08:40 +00:00
|
|
|
}
|
|
|
|
}
|