schema([ TextInput::make('name') ->label('Name') ->required() ->maxLength(255), Select::make('type') ->label('Type') ->options([ 'endcustomer' => 'Endcustomer', 'reseller' => 'Reseller', ]) ->required(), TextInput::make('price') ->label('Price') ->prefix('€') ->numeric() ->step(0.01) ->required() ->default(0), TextInput::make('max_photos') ->label('Max Photos') ->numeric() ->nullable(), TextInput::make('max_guests') ->label('Max Guests') ->numeric() ->nullable(), TextInput::make('gallery_days') ->label('Gallery Days') ->numeric() ->nullable(), TextInput::make('max_tasks') ->label('Max Tasks') ->numeric() ->nullable(), Toggle::make('watermark_allowed') ->label('Watermark Allowed') ->default(true), Toggle::make('branding_allowed') ->label('Branding Allowed') ->default(false), TextInput::make('max_events_per_year') ->label('Max Events per Year') ->numeric() ->nullable(), Repeater::make('features') ->label('Features') ->schema([ TextInput::make('key') ->label('Feature Key'), TextInput::make('value') ->label('Feature Value'), ]) ->columns(2) ->defaultItems(0), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name') ->label('Name') ->searchable() ->sortable(), TextColumn::make('type') ->label('Type') ->badge() ->color(fn (string $state): string => match ($state) { 'endcustomer' => 'info', 'reseller' => 'warning', default => 'gray', }), TextColumn::make('price') ->label('Price') ->money('EUR') ->sortable(), IconColumn::make('max_photos') ->label('Max Photos') ->icon('heroicon-o-photo') ->color('primary'), TextColumn::make('features') ->label('Features') ->limit(50), ]) ->filters([ // ]) ->actions([ EditAction::make(), DeleteAction::make(), ]) ->bulkActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListPackages::route('/'), 'create' => Pages\CreatePackage::route('/create'), 'edit' => Pages\EditPackage::route('/{record}/edit'), ]; } }