schema([ Forms\Components\Wizard::make([ Forms\Components\Wizard\Step::make('Products') ->live() ->schema([ Forms\Components\Repeater::make('products') ->live() ->schema([ Forms\Components\Select::make('product_id') ->options([ 123456 => "Samsung TV", 234567 => "LG TV", 345678 => "Philips TV", 456789 => "Toshiba TV", ]) ->required(), ]), ]), Forms\Components\Wizard\Step::make('Services') ->schema(function (Forms\Get $get) { return collect($get('products'))->mapWithKeys(function ($product, $key) { ray($key); return [ $key => Forms\Components\Grid::make() ->key($key) ->schema([ Forms\Components\Toggle::make(sprintf('services.%d.toggle', $key)) ->label(__('Should the product be installed?')) ->live(true, true), Forms\Components\TextInput::make(sprintf('toggle_question.%d', $key)) ->label(__('What kind of installation?')) ->visible(function (Forms\Get $get) use ($key) { return $get(sprintf('services.%d.toggle', $key)); }), ]) ]; })->toArray(); }) ]) ->columnSpanFull() ]); } public static function getPages(): array { return [ 'index' => Pages\ListOrders::route('/'), 'create' => Pages\CreateOrder::route('/create'), 'edit' => Pages\EditOrder::route('/{record}/edit'), ]; } }