© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
neverender24

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)
]),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to access parent record inside repeater field?
FilamentFFilament / ❓┊help
3y ago
Repeater access current $record
FilamentFFilament / ❓┊help
3y ago
How to implements repeater inside repeater
FilamentFFilament / ❓┊help
3y ago
Access to repeater item from inside
FilamentFFilament / ❓┊help
3y ago