Level 51
Forms\Components\Select::make('course_trainer_id')
->relationship(
relationship: 'trainers',
titleAttribute: 'name',
modifyQueryUsing: fn (Builder $query) => $query->where('is_trainer', true)
)
->preload()
->searchable(),
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to access a list of users who have a boolean "is_trainers" = true, kindly assist
Forms\Components\Select::make('course_trainer_id')
->relationship('trainers', 'name')
->preload()
->searchable()
->options(function (callable $get) {
return $get('users')
->where('is_trainer', true)
->pluck('id', 'name');
}),
Laravel 1o, Filament V3
Please or to participate in this conversation.