components([ TextInput::make('geschoss') ->required() ->maxLength(255), ]); } public function table(Table $table): Table { return $table ->recordTitleAttribute('top_nummer') ->columns([ TextColumn::make('top_nummer')->searchable(), TextColumn::make('geschoss')->searchable(), TextColumn::make('raumart')->searchable(), TextInputColumn::make('flaeche') ->summarize(Sum::make()->label('Gesammt')) ->width('2rem') ->alignment('right') // ->formatStateUsing(fn ($state) => "{$state} m²") ->label('Fläche') // ->numeric(decimalPlaces: 2) ->searchable(), ]) ->filters([ SelectFilter::make('top_nummer') ->searchable() ->options(function (): array { return Raeumealle::where('projekte_id', $this->getOwnerRecord()->id)->groupBy('top_nummer')->orderBy('top_nummer')->pluck('top_nummer', 'top_nummer')->toArray(); }) ->attribute('top_nummer'), ]) // ], layout: FiltersLayout::AboveContentCollapsible) ->headerActions([ CreateAction::make() ->icon('phosphor-file-plus'), ImportAction::make() ->importer(RaeumealleImporter::class) ->label('Hochladen') ->icon('phosphor-upload') ->color('info') ->options([ 'projekte_id' => $this->getOwnerRecord()->id, ]) ->fileRules([ File::types(['csv', 'txt'])->max(1024), ]), ]) ->recordActions([ EditAction::make()->iconButton()->color('gray'), DeleteAction::make()->iconButton(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } }