proejct wildcard domain

This commit is contained in:
Andras Bacsai
2023-06-22 15:08:02 +02:00
parent d8adea734f
commit 6aa7cbade0
4 changed files with 33 additions and 20 deletions

View File

@@ -105,6 +105,7 @@ class General extends Component
$scheme = $url->getScheme();
$this->application->fqdn = $scheme . '://' . $this->application->uuid . '.' . $host . $path;
$this->application->save();
$this->emit('success', 'Application settings updated!');
}
public function generateProjectRandomDomain()
{
@@ -115,6 +116,7 @@ class General extends Component
$scheme = $url->getScheme();
$this->application->fqdn = $scheme . '://' . $this->application->uuid . '.' . $host . $path;
$this->application->save();
$this->emit('success', 'Application settings updated!');
}
public function submit()
{

View File

@@ -8,14 +8,22 @@ use Livewire\Component;
class Edit extends Component
{
public Project $project;
public string|null $wildcard_domain = null;
protected $rules = [
'project.name' => 'required|min:3|max:255',
'project.description' => 'nullable|string|max:255',
'wildcard_domain' => 'nullable|string|max:255',
];
public function mount()
{
$this->wildcard_domain = $this->project->settings->wildcard_domain;
}
public function submit()
{
$this->validate();
try {
$this->project->settings->wildcard_domain = $this->wildcard_domain;
$this->project->settings->save();
$this->project->save();
$this->emit('saved');
} catch (\Exception $e) {