Select field [mountedActionsData.0.brand_id] must have a [createOptionUsing()] closure set.
how i can fix it? code:
return $form
->schema([
TextInput::make('name')
->required()
->maxLength(255)
->minLength(2),
Select::make('brand_id')
->label('Brand')
->multiple()
->searchable()
->required()
->options(Brand::pluck('name', 'id'))
->preload()
->createOptionForm([
TextInput::make('name')
->required()
->label('New Brand'),
]),
Select::make('subbrand_id')
->label('Subbrand')
->multiple()
->searchable()
->options(Subbrand::pluck('name', 'id'))
->columnSpan('full')
->preload()
->createOptionForm([
TextInput::make('name')
->required()
->label('New Subbrand'),
]),
]);
return $form
->schema([
TextInput::make('name')
->required()
->maxLength(255)
->minLength(2),
Select::make('brand_id')
->label('Brand')
->multiple()
->searchable()
->required()
->options(Brand::pluck('name', 'id'))
->preload()
->createOptionForm([
TextInput::make('name')
->required()
->label('New Brand'),
]),
Select::make('subbrand_id')
->label('Subbrand')
->multiple()
->searchable()
->options(Subbrand::pluck('name', 'id'))
->columnSpan('full')
->preload()
->createOptionForm([
TextInput::make('name')
->required()
->label('New Subbrand'),
]),
]);
2 Replies
anyone?
It';s expecting the creatOptionUsing after you submit the form https://filamentphp.com/docs/3.x/forms/fields/select#customizing-new-option-creation