createOptionForm - how to import form schema, is it possible?

I'm using a separate form schema to try and cut down on repetition and mistakes, and so far so good it imports and seems to work:

protected function getFormSchema(): array
    {
        return \App\FormSchemas\UserFormSchema::schema();
    }


As part of that schema I want there to be a createOptionForm on one of the drop down selects that imports the schema from yet another file (
\App\FormSchemas\CategoryFormSchema::schema()
):

Card::make()
   ->schema([
      Forms\Components\Select::make('category_id')
          ->options(Category::all()->pluck('name', 'id'))
          ->required()
          ->createOptionForm([
                            
          ]),
    ]),


But I'm not sure what I can pass to createOptionForm to make it work, I've tried a bunch of stuff like throwing darts at a board and got nowhere.

I've tried:

->createOptionForm(function () {
              return \App\FormSchemas\CategoryFormSchema::schema();
          }),


Which doesn't throw an error like other options, but when clicking the button nothing happens... is it not possible to nest these imports?
Was this page helpful?