createFormOptions leading to infinite loop… #14737
-
PackagePanel builder Package Versionv3.2 How can we help you?Hello, In the table of the resource Human, I have a field called "parent" and listing "Human". I wanted to add a public static function form(Form $form): Form
{
return $form
->schema(self::getFormSchema());
}
public static function getFormSchema(): array
{
return [
…
Forms\Components\Select::make('parent')
->relationship(titleAttribute: 'name')
->native(false)
->preload()
->searchable()
->createOptionForm(self::getFormSchema()),
…
];
} Is there any solution ? I have to create the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is expected since you are recursively calling this.
To avoid this, add a property to the |
Beta Was this translation helpful? Give feedback.
This is expected since you are recursively calling this.
getFormSchema()
contains your Select that callsgetFormSchema()
- this causes an infinite loop.To avoid this, add a property to the
getFormSchema()
to remove the select. For example,getFormSchema($withSelect = true)
and call it with that parameter set tofalse
in your Select option form.