How to access $record in RelationManager inside Repeater Select

What I am trying to do: I have a RelationManager and I want to access $record inside getSearchResultsUsing() which is in a repeater, I do this for additional query filter in the select search My issue/the error: $record always return null, inside the repeater, the $record outside it seem to do fine. Code:
Action::make('Serve')
->form([
Section::make('')->schema([
Placeholder::make('Type')
->content(fn (Model $record): string => $record->bloodType->description),
Placeholder::make('Component')
->content(fn (Model $record): string => $record->bloodComponent->description),
Placeholder::make('Quantity')
->content(fn (Model $record): string => $record->qty),
])
->columns(3),
Repeater::make('order')
->relationship('dispositions')
->simple(
Select::make('disposition')
->searchable()
->getSearchResultsUsing(function ($record, string $search) {

dd($record); //ALWAYS NULL

}
)
->getOptionLabelUsing(fn ($value): ?string => Disposition::find($value)?->serial),
)
->columns(2)
]),
Action::make('Serve')
->form([
Section::make('')->schema([
Placeholder::make('Type')
->content(fn (Model $record): string => $record->bloodType->description),
Placeholder::make('Component')
->content(fn (Model $record): string => $record->bloodComponent->description),
Placeholder::make('Quantity')
->content(fn (Model $record): string => $record->qty),
])
->columns(3),
Repeater::make('order')
->relationship('dispositions')
->simple(
Select::make('disposition')
->searchable()
->getSearchResultsUsing(function ($record, string $search) {

dd($record); //ALWAYS NULL

}
)
->getOptionLabelUsing(fn ($value): ?string => Disposition::find($value)?->serial),
)
->columns(2)
]),
1 Reply
neverender24
neverender24OP13mo ago
squint
Want results from more Discord servers?
Add your server