50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Ui\System\Form;
|
|
|
|
use App\Models\Setting;
|
|
use Livewire\Component;
|
|
|
|
class DomainsSslForm extends Component
|
|
{
|
|
// fix / readonly aus ENV oder config
|
|
public string $mail_domain_readonly = '';
|
|
|
|
// editierbar
|
|
public string $ui_domain = '';
|
|
public string $webmail_domain = '';
|
|
|
|
protected function rules(): array
|
|
{
|
|
return [
|
|
'ui_domain' => 'nullable|string|max:190',
|
|
'webmail_domain' => 'nullable|string|max:190',
|
|
];
|
|
}
|
|
|
|
public function mount(): void
|
|
{
|
|
$this->mail_domain_readonly = (string) config('mailwolt.domain.mail', 'mx');
|
|
$this->ui_domain = Setting::get('ui_domain', $this->ui_domain);
|
|
$this->webmail_domain = Setting::get('webmail_domain', $this->webmail_domain);
|
|
}
|
|
|
|
public function save(): void
|
|
{
|
|
$this->validate();
|
|
|
|
Setting::put('ui_domain', $this->ui_domain);
|
|
Setting::put('webmail_domain', $this->webmail_domain);
|
|
|
|
$this->dispatch('toast',
|
|
type: 'done',
|
|
badge: 'System',
|
|
title: 'Domains gespeichert',
|
|
text: 'UI- und Webmail-Domain wurden übernommen.',
|
|
duration: 5000,
|
|
);
|
|
}
|
|
|
|
public function render() { return view('livewire.ui.system.form.domains-ssl-form'); }
|
|
}
|