Only arrays and Traversables can be unpacked, null given when use

Hello friends i have a problem when i create a category using a service resource... i have a createOptionForm and it's working, the register is created in the table, but i have this error when i create a new category...

Forms\Components\Section::make('Categorías')
                    ->schema([
                        Forms\Components\Select::make('categories')
                            ->label('Categorías')
                            ->relationship('categories', 'name')
                            ->multiple()
                            ->preload()
                            ->createOptionForm([
                                Forms\Components\TextInput::make('name')
                                    ->label('Nombre de la Categoría')
                                    ->required(),
                            ])
                    ])
                    ->collapsible(),

i have this Models
Was this page helpful?