Add updatedApplicationFqdn method to ServiceApplicationView

This commit is contained in:
Andras Bacsai 2024-04-05 15:59:59 +02:00
parent 3cdccb49ef
commit c223408c3c

View File

@ -24,6 +24,16 @@ public function render()
{
return view('livewire.project.service.service-application-view');
}
public function updatedApplicationFqdn()
{
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
$this->application->save();
}
public function instantSave()
{
$this->submit();