Required "Select" forms component saving empty data.

  • Create a select form component and make it required
  • Open the page and fill the rest of the form but keep the select empty (placeholder)
  • Save the form = it will give error to choose from the select
  • Now select any option and save again
    = the chosen option will not be saved
  • try to open the page again to update = you will see that the select has nothing chosen.
Note: if I will open the form and and choose select option before trying to save in the first place = data will be saved without any issues.

is this a bug, or am I doing something wrong

Forms\Components\Select::make('menu_section_id')
                        ->relationship('menuSection', 'description')
                        ->options($sectionOptions)
                        ->default($defaultSection)
                        ->required(),
image.png
Was this page helpful?