lasthourcloud/app/Http/Livewire/Project/Service/Database.php
2023-09-25 15:48:43 +02:00

38 lines
897 B
PHP

<?php
namespace App\Http\Livewire\Project\Service;
use App\Models\ServiceApplication;
use App\Models\ServiceDatabase;
use Livewire\Component;
class Database extends Component
{
public ServiceDatabase $database;
protected $rules = [
'database.human_name' => 'nullable',
'database.description' => 'nullable',
'database.ignore_from_status' => 'required|boolean',
];
public function render()
{
return view('livewire.project.service.database');
}
public function instantSave() {
$this->submit();
}
public function submit()
{
try {
$this->validate();
$this->database->save();
$this->emit('success', 'Database saved successfully.');
} catch (\Throwable $e) {
ray($e);
} finally {
$this->emit('generateDockerCompose');
}
}
}