adrema/modules/Invoice/Components/SettingView.php

55 lines
2.6 KiB
PHP
Raw Normal View History

2024-10-14 21:21:19 +02:00
<?php
namespace Modules\Invoice\Components;
use App\Module\Module;
use Illuminate\Validation\Rule;
use Livewire\Component;
use Modules\Invoice\InvoiceSettings;
use Modules\Module\ModuleSettings;
class SettingView extends Component
{
public $settingClass = InvoiceSettings::class;
public InvoiceSettings $settings;
public function mount(): void
{
$this->settings = app(InvoiceSettings::class);
}
public function save(): void
{
$this->settings->save();
$this->dispatch('success', 'Einstellungen gespeichert.');
}
public function render()
{
return <<<'HTML'
<x-page::setting-layout :active="$settingClass">
<x-slot:right>
<x-form::save-button form="billsettingform"></x-form::save-button>
</x-slot:right>
<form id="billsettingform" class="grow p-6 grid grid-cols-2 gap-3 items-start content-start" wire:submit.prevent="save">
<x-form::text name="from" wire:model="settings.from" label="Absender" hint="Absender-Name in Kurzform, i.d.R. der kurze Stammesname"></x-form::text>
<x-form::text name="from_long" wire:model="settings.from_long" label="Absender (lang)" hint="Absender-Name in Langform, i.d.R. der Stammesname"></x-form::text>
2024-10-25 01:58:27 +02:00
<x-ui::setting-intro class="col-span-full mt-5" title="Kontaktdaten">
Hier kannst du deine Zugangsdaten zu NaMi anpassen, falls sich z.B. dein Passwort geändert hat.
</x-ui::setting-intro>
2024-10-14 21:21:19 +02:00
<x-form::text name="address" wire:model="settings.address" label="Straße"></x-form::text>
<x-form::text name="zip" wire:model="settings.zip" label="PLZ"></x-form::text>
<x-form::text name="place" wire:model="settings.place" label="Ort"></x-form::text>
<x-form::text name="email" wire:model="settings.email" label="E-Mail-Adresse"></x-form::text>
<x-form::text name="mobile" wire:model="settings.mobile" label="Telefonnummer"></x-form::text>
<x-form::text name="website" wire:model="settings.website" label="Webseite"></x-form::text>
<x-form::text name="iban" wire:model="settings.iban" label="IBAN"></x-form::text>
<x-form::text name="bic" wire:model="settings.bic" label="BIC"></x-form::text>
<x-form::text name="remember_weeks" wire:model="settings.rememberWeeks" type="number" label="Erinnerung alle X Wochen versenden"></x-form::text>
</form>
</x-page::setting-layout>
HTML;
}
}