Phase 2: Kalender, Anfrage, Vorreservierung & Sonderangebote

- Gäste, Buchungen (Status-Workflow), Sperrzeiten, Sonderangebote
- Vorreservierung mit Haltezeit je Wohnung; abgelaufene Holds geben den Kalender sofort frei, Cron setzt Status und benachrichtigt
- Sonderangebote/Sonderkonditionen: %, € pro Aufenthalt, Sonderpreis/Nacht, Gratis-Nächte; Bedingungen u. a. Saison, Vorlauf, Wochentag, Nächte, Aktionscode; bestes Einzel- vs. kombinierte Angebote
- Öffentliche Seite /buchen: Belegungskalender, Live-Preis, Anfrageformular (Honeypot, Rate-Limit)
- E-Mails: Angebot an Gast, Benachrichtigung Vermieter, Bestätigung, Absage, Ablauf
- Filament: Anfragen & Buchungen (bestätigen, ablehnen, verlängern, stornieren, Telefonbuchung), Gäste, Sperrzeiten, Sonderangebote
- Deutsche Validierungstexte

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 09:43:12 +02:00
1 parent 2e9a391b37
commit 08b6582fa1
79 files changed
+6213 -76

No files matched your search

+30 -2
View File
@@ -4,6 +4,34 @@
@source '../../storage/framework/views/*.php';
@theme {
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--color-sea-50: oklch(0.97 0.015 230);
--color-sea-100: oklch(0.93 0.035 230);
--color-sea-700: oklch(0.45 0.11 235);
--color-sea-800: oklch(0.38 0.1 237);
--color-sea-900: oklch(0.3 0.08 240);
--color-sand-50: oklch(0.985 0.008 85);
}
@layer base {
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
border-width: 1px;
padding: 0.5rem 0.75rem;
background-color: white;
}
input[type='checkbox'] {
width: 1rem;
height: 1rem;
accent-color: var(--color-sea-700);
}
:focus-visible {
outline: 2px solid var(--color-sea-700);
outline-offset: 2px;
}
}
+11
View File
@@ -0,0 +1,11 @@
<x-layouts.site title="Preise & Buchung" description="Freie Termine, Preise und unverbindliche Buchungsanfrage für die Ferienwohnung Stommer in Kühlungsborn.">
<h1 class="text-3xl font-semibold tracking-tight text-sea-900">Preise &amp; Buchung</h1>
<p class="mt-2 max-w-2xl text-slate-600">
Wählen Sie im Kalender Ihren Anreise- und Abreisetag. Sie sehen sofort den Gesamtpreis inklusive aller Nebenkosten.
Ihre Anfrage ist unverbindlich – wir halten den Termin für Sie vor und bestätigen kurzfristig.
</p>
<div class="mt-8">
<livewire:booking-request />
</div>
</x-layouts.site>
@@ -0,0 +1,39 @@
@props(['title' => null, 'description' => null])
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $title ? $title.' · ' : '' }}Ferienwohnung Stommer in Kühlungsborn</title>
@if ($description)
<meta name="description" content="{{ $description }}">
@endif
@vite(['resources/css/app.css', 'resources/js/app.js'])
@livewireStyles
</head>
<body class="min-h-screen bg-sand-50 text-slate-800 antialiased">
<a href="#inhalt" class="sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:rounded focus:bg-white focus:px-4 focus:py-2">Zum Inhalt springen</a>
<header class="border-b border-slate-200 bg-white">
<div class="mx-auto flex max-w-6xl items-center justify-between px-4 py-4">
<a href="{{ url('/') }}" class="text-lg font-semibold tracking-tight text-sea-900">Ferienwohnung Stommer</a>
<nav aria-label="Hauptnavigation" class="flex gap-6 text-sm font-medium">
<a href="{{ route('booking.create') }}" class="text-sea-700 hover:text-sea-900">Preise &amp; Buchung</a>
</nav>
</div>
</header>
<main id="inhalt" class="mx-auto max-w-6xl px-4 py-10">
{{ $slot }}
</main>
<footer class="border-t border-slate-200 bg-white">
<div class="mx-auto max-w-6xl px-4 py-6 text-sm text-slate-500">
{{ config('fewo.owner.name') }} · {{ config('fewo.owner.street') }} · {{ config('fewo.owner.city') }} ·
<a href="mailto:{{ config('fewo.owner.email') }}" class="underline">{{ config('fewo.owner.email') }}</a>
</div>
</footer>
@livewireScripts
</body>
</html>
@@ -0,0 +1,211 @@
<div>
@if ($booking)
<div class="rounded-2xl border border-emerald-200 bg-emerald-50 p-8" role="status">
<h2 class="text-2xl font-semibold text-emerald-900">Vielen Dank, {{ $booking->guest->first_name }}!</h2>
<p class="mt-3 text-emerald-900">
Ihre Anfrage <strong>{{ $booking->reference }}</strong> ist eingegangen. Wir haben den Zeitraum
<strong>{{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}</strong>
bis <strong>{{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr</strong> für Sie vorgemerkt.
</p>
<p class="mt-2 text-emerald-900">Eine Bestätigung mit allen Details haben wir an {{ $booking->guest->email }} gesendet.</p>
</div>
@else
<div class="grid gap-8 lg:grid-cols-5">
{{-- Calendar --}}
<section class="lg:col-span-3" aria-labelledby="calendar-heading">
<div class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm">
<div class="flex items-center justify-between">
<h2 id="calendar-heading" class="text-lg font-semibold text-sea-900">Belegung</h2>
<div class="flex gap-2">
<button type="button" wire:click="previousMonth" class="rounded-lg border border-slate-200 px-3 py-1.5 text-sm hover:bg-slate-50" aria-label="Vorheriger Monat">‹</button>
<button type="button" wire:click="nextMonth" class="rounded-lg border border-slate-200 px-3 py-1.5 text-sm hover:bg-slate-50" aria-label="Nächster Monat">›</button>
</div>
</div>
<div class="mt-4 grid gap-6 sm:grid-cols-2">
@foreach ($this->calendar as $month)
<div wire:key="month-{{ $month['label'] }}">
<h3 class="mb-2 text-center text-sm font-semibold text-slate-700">{{ $month['label'] }}</h3>
<table class="w-full table-fixed text-center text-sm">
<thead>
<tr class="text-xs text-slate-400">
@foreach (['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] as $weekday)
<th scope="col" class="pb-1 font-medium">{{ $weekday }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($month['weeks'] as $week)
<tr>
@foreach (array_pad($week, 7, null) as $day)
<td class="p-0.5">
@if ($day)
<button type="button"
wire:click="selectDate('{{ $day['date'] }}')"
@disabled($day['past'])
aria-pressed="{{ $day['selected'] ? 'true' : 'false' }}"
aria-label="{{ \Carbon\CarbonImmutable::parse($day['date'])->translatedFormat('l, d. F Y') }}{{ $day['free'] ? '' : ' (Nacht belegt)' }}"
@class([
'aspect-square w-full rounded-lg text-sm transition',
'cursor-not-allowed text-slate-300' => $day['past'],
'bg-sea-700 font-semibold text-white' => $day['selected'],
'bg-sea-100 text-sea-900' => $day['inRange'] && ! $day['selected'],
'bg-rose-100 text-rose-800 line-through decoration-rose-300' => ! $day['free'] && ! $day['past'] && ! $day['selected'],
'hover:bg-sea-50' => $day['free'] && ! $day['past'] && ! $day['selected'] && ! $day['inRange'],
])>
{{ $day['day'] }}
</button>
@endif
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
@endforeach
</div>
<div class="mt-4 flex flex-wrap gap-4 text-xs text-slate-500">
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-white ring-1 ring-slate-300"></span> frei</span>
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-rose-100"></span> Nacht belegt (Abreise möglich)</span>
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-sea-700"></span> Ihre Auswahl</span>
</div>
</div>
<div class="mt-4 grid gap-4 sm:grid-cols-3">
<label class="block text-sm">
<span class="font-medium text-slate-700">Anreise</span>
<input type="date" wire:model.live="arrival" min="{{ today()->toDateString() }}" class="mt-1 w-full rounded-lg border-slate-300">
</label>
<label class="block text-sm">
<span class="font-medium text-slate-700">Abreise</span>
<input type="date" wire:model.live="departure" min="{{ $arrival ?? today()->toDateString() }}" class="mt-1 w-full rounded-lg border-slate-300">
</label>
<label class="block text-sm">
<span class="font-medium text-slate-700">Personen</span>
<select wire:model.live="guests" class="mt-1 w-full rounded-lg border-slate-300">
@for ($count = 1; $count <= $this->property->max_guests; $count++)
<option value="{{ $count }}">{{ $count }}</option>
@endfor
</select>
</label>
</div>
@error('arrival') <p class="mt-2 text-sm text-rose-700" role="alert">{{ $message }}</p> @enderror
@error('departure') <p class="mt-2 text-sm text-rose-700" role="alert">{{ $message }}</p> @enderror
</section>
{{-- Price and form --}}
<section class="lg:col-span-2" aria-labelledby="price-heading">
<div class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" aria-live="polite">
<h2 id="price-heading" class="text-lg font-semibold text-sea-900">Ihr Preis</h2>
@php($pricing = $this->pricing)
@if ($pricing['error'])
<p class="mt-3 rounded-lg bg-amber-50 p-3 text-sm text-amber-900">{{ $pricing['error'] }}</p>
@elseif ($pricing['quote'])
@php($quote = $pricing['quote'])
<p class="mt-1 text-sm text-slate-500">
{{ $quote->arrival->format('d.m.Y') }} – {{ $quote->departure->format('d.m.Y') }} · {{ $quote->nights() }} Nächte · {{ $quote->guests }} {{ $quote->guests === 1 ? 'Person' : 'Personen' }}
<button type="button" wire:click="clearDates" class="ml-1 underline">ändern</button>
</p>
<dl class="mt-4 space-y-1.5 text-sm">
@foreach ($quote->lines as $line)
<div @class(['flex justify-between gap-4', 'text-emerald-700 font-medium' => $line->amount < 0])>
<dt>{{ $line->label }}</dt>
<dd class="tabular-nums">{{ \App\Support\Money::format($line->amount) }}</dd>
</div>
@endforeach
<div class="flex justify-between gap-4 border-t border-slate-200 pt-2 text-base font-semibold text-sea-900">
<dt>Gesamtpreis</dt>
<dd class="tabular-nums">{{ \App\Support\Money::format($quote->total()) }}</dd>
</div>
</dl>
<p class="mt-2 text-xs text-slate-500">
Anzahlung {{ \App\Support\Money::format($quote->deposit()) }}, Rest bis {{ $quote->balanceDueOn->format('d.m.Y') }}. Kurtaxe wird vor Ort berechnet.
</p>
@if ($quote->promoCodeApplied === false)
<p class="mt-2 text-sm text-amber-800">Der Aktionscode ist für diesen Zeitraum nicht gültig.</p>
@endif
@else
<p class="mt-3 text-sm text-slate-500">Bitte wählen Sie im Kalender Anreise und Abreise.</p>
@endif
@if ($this->availableExtras->isNotEmpty())
<fieldset class="mt-5 border-t border-slate-100 pt-4">
<legend class="text-sm font-medium text-slate-700">Zusatzleistungen</legend>
<div class="mt-2 space-y-2">
@foreach ($this->availableExtras as $extra)
<label class="flex items-center justify-between gap-3 text-sm" wire:key="extra-{{ $extra->id }}">
<span>
{{ $extra->name }} <span class="text-slate-500">({{ \App\Support\Money::format($extra->price) }})</span>
@if ($extra->description)<br><span class="text-xs text-slate-500">{{ $extra->description }}</span>@endif
</span>
<select wire:model.live="extras.{{ $extra->id }}" class="w-20 rounded-lg border-slate-300 text-sm">
@for ($quantity = 0; $quantity <= $this->property->max_guests; $quantity++)
<option value="{{ $quantity }}">{{ $quantity }}</option>
@endfor
</select>
</label>
@endforeach
</div>
</fieldset>
@endif
<label class="mt-4 block text-sm">
<span class="font-medium text-slate-700">Aktionscode</span>
<input type="text" wire:model.live.debounce.600ms="promoCode" autocomplete="off" class="mt-1 w-full rounded-lg border-slate-300">
</label>
</div>
<form wire:submit="submit" class="mt-6 rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" novalidate>
<h2 class="text-lg font-semibold text-sea-900">Unverbindlich anfragen</h2>
<div class="mt-4 grid gap-4 sm:grid-cols-2">
@foreach ([
['firstName', 'Vorname', 'text', 'given-name', true],
['lastName', 'Nachname', 'text', 'family-name', true],
['email', 'E-Mail', 'email', 'email', true],
['phone', 'Telefon', 'tel', 'tel', false],
['street', 'Straße & Hausnr.', 'text', 'street-address', false],
['postalCode', 'PLZ', 'text', 'postal-code', false],
['city', 'Ort', 'text', 'address-level2', false],
] as [$field, $label, $type, $autocomplete, $required])
<label class="block text-sm" wire:key="field-{{ $field }}">
<span class="font-medium text-slate-700">{{ $label }}@if ($required)<span class="text-rose-600" aria-hidden="true"> *</span>@endif</span>
<input type="{{ $type }}" wire:model="{{ $field }}" autocomplete="{{ $autocomplete }}" @required($required)
@error($field) aria-invalid="true" aria-describedby="{{ $field }}-error" @enderror
class="mt-1 w-full rounded-lg border-slate-300">
@error($field) <span id="{{ $field }}-error" class="mt-1 block text-xs text-rose-700">{{ $message }}</span> @enderror
</label>
@endforeach
</div>
<label class="mt-4 block text-sm">
<span class="font-medium text-slate-700">Nachricht</span>
<textarea wire:model="message" rows="3" class="mt-1 w-full rounded-lg border-slate-300"></textarea>
</label>
<div class="hidden" aria-hidden="true">
<label>Website <input type="text" wire:model="website" tabindex="-1" autocomplete="off"></label>
</div>
<label class="mt-4 flex items-start gap-2 text-sm">
<input type="checkbox" wire:model="privacyAccepted" class="mt-0.5 rounded border-slate-300">
<span>Ich bin einverstanden, dass meine Angaben zur Bearbeitung der Anfrage gespeichert werden (siehe Datenschutzerklärung).<span class="text-rose-600" aria-hidden="true"> *</span></span>
</label>
@error('privacyAccepted') <p class="mt-1 text-xs text-rose-700">{{ $message }}</p> @enderror
<button type="submit"
@disabled(! $pricing['quote'])
wire:loading.attr="disabled"
class="mt-5 w-full rounded-xl bg-sea-700 px-4 py-3 font-semibold text-white shadow-sm transition hover:bg-sea-800 disabled:cursor-not-allowed disabled:opacity-50">
<span wire:loading.remove wire:target="submit">Termin vormerken &amp; Angebot erhalten</span>
<span wire:loading wire:target="submit">Wird gesendet …</span>
</button>
<p class="mt-2 text-center text-xs text-slate-500">Kostenlos und unverbindlich. Verbindlich wird die Buchung erst mit unserer Bestätigung.</p>
</form>
</section>
</div>
@endif
</div>
@@ -0,0 +1,34 @@
<x-mail::message>
# Ihre Buchung ist bestätigt!
Guten Tag {{ $booking->guest->full_name }},
wir freuen uns, Ihre Buchung der **{{ $booking->property->name }}** verbindlich zu bestätigen.
**Anreise:** {{ $booking->arrival->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_in_time) ab {{ substr($booking->property->check_in_time, 0, 5) }} Uhr @endif<br>
**Abreise:** {{ $booking->departure->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_out_time) bis {{ substr($booking->property->check_out_time, 0, 5) }} Uhr @endif<br>
**Personen:** {{ $booking->guests }}<br>
**Buchungsnummer:** {{ $booking->reference }}
@include('mail.partials.quote')
## Zahlung
Bitte überweisen Sie die Anzahlung von **{{ \App\Support\Money::format($booking->deposit) }}** innerhalb von {{ config('fewo.deposit_due_days') }} Tagen und den Restbetrag von **{{ \App\Support\Money::format($booking->total - $booking->deposit) }}** bis zum {{ $booking->balance_due_on->format('d.m.Y') }}.
@if (config('fewo.bank.iban'))
<x-mail::panel>
Kontoinhaber: {{ config('fewo.bank.account_holder') }}<br>
IBAN: {{ config('fewo.bank.iban') }}<br>
@if (config('fewo.bank.bic'))
BIC: {{ config('fewo.bank.bic') }}<br>
@endif
Verwendungszweck: {{ $booking->reference }}
</x-mail::panel>
@endif
Rechtzeitig vor Ihrer Anreise erhalten Sie von uns alle Informationen zu Schlüsselübergabe, Parken und WLAN.
Herzliche Grüße<br>
{{ config('fewo.owner.name') }}
</x-mail::message>
@@ -0,0 +1,16 @@
<x-mail::message>
# Ihre Anfrage {{ $booking->reference }}
Guten Tag {{ $booking->guest->full_name }},
vielen Dank für Ihr Interesse an der **{{ $booking->property->name }}**. Leider können wir Ihnen den Zeitraum vom {{ $booking->arrival->format('d.m.Y') }} bis {{ $booking->departure->format('d.m.Y') }} nicht anbieten.
Vielleicht passt ein anderer Termin? Die freien Zeiträume finden Sie jederzeit in unserem Belegungskalender.
<x-mail::button :url="route('booking.create')">
Freie Termine ansehen
</x-mail::button>
Herzliche Grüße<br>
{{ config('fewo.owner.name') }}
</x-mail::message>
@@ -0,0 +1,25 @@
<x-mail::message>
# Neue Anfrage {{ $booking->reference }}
**{{ $booking->guest->full_name }}** möchte die **{{ $booking->property->name }}** buchen.
**Zeitraum:** {{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }} ({{ $booking->nights() }} Nächte)<br>
**Personen:** {{ $booking->guests }}<br>
**E-Mail:** {{ $booking->guest->email }}<br>
**Telefon:** {{ $booking->guest->phone ?: '–' }}<br>
@if ($booking->promo_code)
**Aktionscode:** {{ $booking->promo_code }}<br>
@endif
**Vorgemerkt bis:** {{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr
@include('mail.partials.quote')
@if ($booking->message)
**Nachricht des Gastes:**<br>
{{ $booking->message }}
@endif
<x-mail::button :url="\App\Filament\Resources\Bookings\BookingResource::getUrl('view', ['record' => $booking])">
Anfrage bestätigen oder ablehnen
</x-mail::button>
</x-mail::message>
@@ -0,0 +1,13 @@
<x-mail::table>
| Leistung | Betrag |
|:---------|-------:|
@foreach ($booking->quote['lines'] as $line)
| {{ $line['label'] }} | {{ \App\Support\Money::format($line['amount']) }} |
@endforeach
| **Gesamtpreis** | **{{ \App\Support\Money::format($booking->total) }}** |
</x-mail::table>
Anzahlung ({{ $booking->property->deposit_percent }} % der Miete): **{{ \App\Support\Money::format($booking->deposit) }}**<br>
Restzahlung: **{{ \App\Support\Money::format($booking->total - $booking->deposit) }}**, fällig bis {{ $booking->balance_due_on->format('d.m.Y') }}
Die Kurtaxe ist nicht enthalten und wird vor Ort entrichtet.
@@ -0,0 +1,11 @@
<x-mail::message>
# Vormerkung abgelaufen
Die Anfrage **{{ $booking->reference }}** von {{ $booking->guest->full_name }} ({{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}) wurde nicht rechtzeitig bestätigt. Der Zeitraum ist im Kalender wieder frei.
Sie können die Anfrage weiterhin bestätigen, sofern der Zeitraum noch frei ist.
<x-mail::button :url="\App\Filament\Resources\Bookings\BookingResource::getUrl('view', ['record' => $booking])">
Anfrage öffnen
</x-mail::button>
</x-mail::message>
@@ -0,0 +1,26 @@
<x-mail::message>
# Vielen Dank für Ihre Anfrage!
Guten Tag {{ $booking->guest->full_name }},
wir haben Ihre Anfrage für die **{{ $booking->property->name }}** erhalten und den Zeitraum für Sie **bis {{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr vorgemerkt**.
**Anreise:** {{ $booking->arrival->translatedFormat('l, d.m.Y') }}<br>
**Abreise:** {{ $booking->departure->translatedFormat('l, d.m.Y') }}<br>
**Personen:** {{ $booking->guests }}<br>
**Anfragenummer:** {{ $booking->reference }}
@include('mail.partials.quote')
Wir prüfen Ihre Anfrage und melden uns in Kürze mit der Buchungsbestätigung. Erst mit unserer Bestätigung ist die Buchung verbindlich.
@if ($booking->message)
**Ihre Nachricht:**<br>
{{ $booking->message }}
@endif
Bei Fragen antworten Sie einfach auf diese E-Mail oder rufen Sie uns an: {{ config('fewo.owner.phone') }}
Herzliche Grüße<br>
{{ config('fewo.owner.name') }}
</x-mail::message>
-1
View File
@@ -6,7 +6,6 @@
<title>{{ config('app.name', 'Laravel') }}</title>
@fonts
<!-- Styles / Scripts -->
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))