Filament: Helper Text in Reactive Live Forms

When building reactive forms with options based on other field values, you can use helperText() with a callback function to show some text in case of no options.

In general, all Filament form methods support closures like this, so you can put custom logic.

Forms\Components\Radio::make('group_id')
->options(function (Get $get) {
// options based on values from other fields
})
->helperText(function(Component $component) {
if (empty($component->getOptions())) {
return 'Sorry, no groups for your criteria';
}
})
->live(),

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 59 courses (1057 lessons, total 42 h 44 min)
  • 79 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord

Recent Premium Tutorials