- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)
Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 lines
2.7 KiB
PHP
80 lines
2.7 KiB
PHP
<?php
|
|
|
|
use App\Models\AdminPreset;
|
|
use Illuminate\Validation\Rule;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Component;
|
|
|
|
new #[Layout('components.layouts.app'), Title('Neue Voreinstellung')] class extends Component
|
|
{
|
|
public string $key = '';
|
|
|
|
public string $area = 'press_releases';
|
|
|
|
public string $type = 'text';
|
|
|
|
public string $label = '';
|
|
|
|
public string $value = '';
|
|
|
|
public string $payload = '';
|
|
|
|
public bool $isActive = true;
|
|
|
|
public function save(): void
|
|
{
|
|
$validated = $this->validate([
|
|
'key' => ['required', 'string', 'max:255', 'regex:/^[a-z0-9_.-]+$/', Rule::unique('admin_presets', 'key')],
|
|
'area' => ['required', 'string', 'max:100'],
|
|
'type' => ['required', Rule::in(['text', 'number', 'boolean', 'json'])],
|
|
'label' => ['required', 'string', 'max:255'],
|
|
'value' => ['nullable', 'string'],
|
|
'payload' => ['nullable', 'json'],
|
|
'isActive' => ['boolean'],
|
|
]);
|
|
|
|
AdminPreset::query()->create([
|
|
'key' => $validated['key'],
|
|
'area' => $validated['area'],
|
|
'type' => $validated['type'],
|
|
'label' => $validated['label'],
|
|
'value' => $validated['value'] ?: null,
|
|
'payload' => filled($validated['payload']) ? json_decode($validated['payload'], true) : null,
|
|
'is_active' => $validated['isActive'],
|
|
]);
|
|
|
|
session()->flash('success', __('Voreinstellung wurde angelegt.'));
|
|
|
|
$this->redirect(route('admin.presets.index'), navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<form wire:submit="save" class="space-y-8">
|
|
{{-- ============== PAGE HEADER ============== --}}
|
|
<x-portal.page-header
|
|
:badge="__('Admin Backend')"
|
|
:eyebrow="__('Administration · Voreinstellungen')"
|
|
:title="__('Neue Voreinstellung')"
|
|
:description="__('Texte, Zahlen oder JSON-Werte zentral fuer Admin-Funktionen pflegen.')"
|
|
>
|
|
<x-slot:actions>
|
|
<flux:button variant="filled" icon="arrow-left" href="{{ route('admin.presets.index') }}" wire:navigate>
|
|
{{ __('Zurück') }}
|
|
</flux:button>
|
|
</x-slot:actions>
|
|
</x-portal.page-header>
|
|
|
|
@include('livewire.admin.presets.partials.form-fields')
|
|
|
|
<article class="panel">
|
|
<div class="p-5 flex justify-end gap-3">
|
|
<flux:button variant="filled" href="{{ route('admin.presets.index') }}" wire:navigate>
|
|
{{ __('Abbrechen') }}
|
|
</flux:button>
|
|
<flux:button type="submit" variant="primary">
|
|
{{ __('Voreinstellung erstellen') }}
|
|
</flux:button>
|
|
</div>
|
|
</article>
|
|
</form>
|