- Datenmodell Property/Season/Extra (Beträge in Cent), Seeder mit Preisliste 2026 - PriceCalculator: Saison-Splitting, Mindestaufenthalt, Zusatzperson, Endreinigung, Extras, Anzahlung/Restzahlung - Filament-Verwaltung: Wohnungen, Saisons (Überschneidungsprüfung, Lückenwarnung, Kopie ins Folgejahr, Preisrechner), Zusatzleistungen - Tests für Preisberechnung und Saisonverwaltung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.7 KiB
PHP
58 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Properties;
|
|
|
|
use App\Filament\Resources\Properties\Pages\CreateProperty;
|
|
use App\Filament\Resources\Properties\Pages\EditProperty;
|
|
use App\Filament\Resources\Properties\Pages\ListProperties;
|
|
use App\Filament\Resources\Properties\RelationManagers\ExtrasRelationManager;
|
|
use App\Filament\Resources\Properties\RelationManagers\SeasonsRelationManager;
|
|
use App\Filament\Resources\Properties\Schemas\PropertyForm;
|
|
use App\Filament\Resources\Properties\Tables\PropertiesTable;
|
|
use App\Models\Property;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
|
|
class PropertyResource extends Resource
|
|
{
|
|
protected static ?string $model = Property::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedHomeModern;
|
|
|
|
protected static ?string $modelLabel = 'Wohnung';
|
|
|
|
protected static ?string $pluralModelLabel = 'Wohnungen';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return PropertyForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return PropertiesTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
SeasonsRelationManager::class,
|
|
ExtrasRelationManager::class,
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListProperties::route('/'),
|
|
'create' => CreateProperty::route('/create'),
|
|
'edit' => EditProperty::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|