- 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>
72 lines
2.0 KiB
PHP
72 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Bookings;
|
|
|
|
use App\Enums\BookingStatus;
|
|
use App\Filament\Resources\Bookings\Pages\CreateBooking;
|
|
use App\Filament\Resources\Bookings\Pages\ListBookings;
|
|
use App\Filament\Resources\Bookings\Pages\ViewBooking;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingForm;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingInfolist;
|
|
use App\Filament\Resources\Bookings\Tables\BookingsTable;
|
|
use App\Models\Booking;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
|
|
class BookingResource extends Resource
|
|
{
|
|
protected static ?string $model = Booking::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCalendarDays;
|
|
|
|
protected static ?string $modelLabel = 'Buchung';
|
|
|
|
protected static ?string $pluralModelLabel = 'Anfragen & Buchungen';
|
|
|
|
protected static ?string $recordTitleAttribute = 'reference';
|
|
|
|
protected static ?int $navigationSort = 1;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return BookingForm::configure($schema);
|
|
}
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return BookingInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return BookingsTable::configure($table);
|
|
}
|
|
|
|
/**
|
|
* Number of open requests waiting for a decision.
|
|
*/
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
$open = Booking::query()->where('status', BookingStatus::Reserved)->count();
|
|
|
|
return $open > 0 ? (string) $open : null;
|
|
}
|
|
|
|
public static function getNavigationBadgeColor(): string
|
|
{
|
|
return 'warning';
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListBookings::route('/'),
|
|
'create' => CreateBooking::route('/create'),
|
|
'view' => ViewBooking::route('/{record}'),
|
|
];
|
|
}
|
|
}
|