44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Setup;
|
|
|
|
use App\Models\Setting;
|
|
use Livewire\Component;
|
|
|
|
class SetupWizard extends Component
|
|
{
|
|
public string $domain = '';
|
|
public string $timezone = 'Europe/Berlin';
|
|
public bool $agree_cert = false;
|
|
|
|
public function mount()
|
|
{
|
|
$this->domain = Setting::get('domain', '');
|
|
$this->timezone = Setting::get('timezone', config('app.timezone'));
|
|
}
|
|
|
|
public function save()
|
|
{
|
|
$this->validate([
|
|
'domain' => ['required','string'],
|
|
'timezone' => ['required','string'],
|
|
]);
|
|
|
|
Setting::set('domain', $this->domain);
|
|
Setting::set('timezone', $this->timezone);
|
|
Setting::set('setup_completed', '1');
|
|
|
|
if ($this->agree_cert) {
|
|
Setting::set('cert_requested', '1'); // Hook für deinen Installer/Daemon
|
|
}
|
|
|
|
session()->flash('ok', 'Setup gespeichert.');
|
|
return redirect()->route('dashboard');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.setup.setup-wizard');
|
|
}
|
|
}
|