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:
  • 68 courses (1183 lessons, total 43 h 18 min)
  • 90 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord

Recent New Courses