Files
fewo-stommer/app/Themes/Sections/FactsSection.php
T
Lars StommerandClaude Opus 5.5 66e82d61f5 Theme-System mit Basis-Theme Ostsee-Licht, Bausteinen und saisonalen Erscheinungsbildern
- Sites (Domain, Theme, Farben; mehrfähig für weitere Vermieter), Seiten aus Bausteinen mit Menüs, Erscheinungsbilder mit jährlichem Zeitplan, Priorität und signierter Vorschau
- Theme-Kern (app/Themes): Manifest, Registry, Vererbung (Child-Themes), Token-Farben als CSS-Variablen, Bausteinkatalog als Registry (config/themes.php)
- 15 Bausteine: Titelbereich mit Suche, Eckdaten, Text mit Bildern, Galerie, Ausstattung, Lage, Preise, Angebote, Kalender & Anfrage, Bewertungen, Gastgeber, FAQ, Abschluss, Kontakt, Fließtext
- Theme Ostsee-Licht: Layout, Kopf/Fuß, Banner, mobile Buchungsleiste, Lightbox, selbst gehostete Schriften, Reduced Motion
- Seiten Start, Wohnung, Kühlungsborn, Preise & Buchung, Kontakt, Impressum, Datenschutz; Sitemap, robots.txt, JSON-LD
- Admin: Seiten-Baukasten, Erscheinungsbilder, Websites
- Dokumentation docs/THEMES.md inkl. Übergabe für die Design-Sitzung

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:04:21 +02:00

47 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Themes\Sections;
use App\Themes\Theme;
use Filament\Forms\Components\TextInput;
/**
* Key facts of the property (size, guests, highlights) – taken from the property and its equipment.
*/
class FactsSection extends Section
{
public static function key(): string
{
return 'facts';
}
public static function label(): string
{
return 'Eckdaten';
}
public static function icon(): string
{
return 'heroicon-o-squares-2x2';
}
public static function schema(): array
{
return [
TextInput::make('heading')->label('Überschrift (optional)')->maxLength(120),
];
}
public function data(Theme $theme, array $data): array
{
$property = $theme->property();
return [
'heading' => $data['heading'] ?? null,
'property' => $property,
'highlights' => $property?->amenities()->where('is_highlight', true)->limit(6)->pluck('name') ?? collect(),
'fromPrice' => $property?->seasons()->whereDate('ends_on', '>', today())->min('nightly_rate'),
];
}
}