Oben im Seitenmenue waehlt man die Wohnung; Listen, neue Eintraege, Belegungsplan und Preise & Angebote folgen ihr. Ein geoeffneter Eintrag einer anderen Wohnung schaltet auf diese um. Galerie und Ersatz-Titelbild der Website zeigen nur Fotos der Wohnung des Bausteins und Fotos ohne Wohnung. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Amenities\Schemas;
|
|
|
|
use App\Enums\AmenityArea;
|
|
use App\Models\Property;
|
|
use App\Support\CurrentProperty;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Toggle;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class AmenityForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->columns(2)
|
|
->components([
|
|
TextInput::make('name')
|
|
->label('Ausstattung')
|
|
->placeholder('z. B. Geschirrspüler')
|
|
->required()
|
|
->maxLength(255),
|
|
Select::make('area')
|
|
->label('Bereich')
|
|
->options(AmenityArea::class)
|
|
->required(),
|
|
Select::make('property_id')
|
|
->label('Wohnung')
|
|
->options(fn (): array => Property::query()->pluck('name', 'id')->all())
|
|
->default(fn (): ?int => app(CurrentProperty::class)->id())
|
|
->required(),
|
|
Toggle::make('is_highlight')
|
|
->label('Highlight (auf der Startseite hervorheben)'),
|
|
]);
|
|
}
|
|
}
|