2023-09-22 09:23:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Project\Service;
|
|
|
|
|
|
|
|
use App\Models\ServiceApplication;
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class Application extends Component
|
|
|
|
{
|
|
|
|
public ServiceApplication $application;
|
|
|
|
protected $rules = [
|
|
|
|
'application.human_name' => 'nullable',
|
2023-09-22 12:47:25 +00:00
|
|
|
'application.description' => 'nullable',
|
2023-09-22 09:23:49 +00:00
|
|
|
'application.fqdn' => 'nullable',
|
|
|
|
];
|
|
|
|
public function render()
|
|
|
|
{
|
2023-09-22 19:31:47 +00:00
|
|
|
ray($this->application->fileStorages()->get());
|
2023-09-22 09:23:49 +00:00
|
|
|
return view('livewire.project.service.application');
|
|
|
|
}
|
|
|
|
public function submit()
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
$this->validate();
|
|
|
|
$this->application->save();
|
|
|
|
} catch (\Throwable $e) {
|
|
|
|
ray($e);
|
|
|
|
} finally {
|
|
|
|
$this->emit('generateDockerCompose');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|