schema([ Forms\Components\TextInput::make('name') ->required() ->maxLength(255), Forms\Components\Select::make('unit') ->label('Mengeneinheit') ->native(false) ->searchable() ->options([ 'grams' => '(Kilo-)Gramm', 'pieces' => 'Stück', 'liter' => 'Liter', ]) ->required(), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('name') ->searchable(), Tables\Columns\TextColumn::make('unit') ->label('Einheit') ->formatStateUsing(fn ($state) => match($state) { 'grams' => '(Kilo-)Gramm', 'pieces' => 'Stück', 'liter' => 'Liter', default => ucfirst($state), }), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ RelationManagers\StockMovementsRelationManager::class, ]; } public static function getPages(): array { return [ 'index' => Pages\ListSpices::route('/'), 'create' => Pages\CreateSpice::route('/create'), 'edit' => Pages\EditSpice::route('/{record}/edit'), ]; } public static function getPluralLabel(): string { return 'Rohstoffe'; // Setze hier deinen eigenen Pluralbegriff ein } }