© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
AsuranDex

Issue with Pivot relation on Repeater

Hello i've been following the steps in the documentation: https://filamentphp.com/docs/3.x/forms/fields/repeater#integrating-with-an-eloquent-relationship

In order to save a pivot relationship in a repeater field. However as soon as i add the "->relationship()" chain to the repeater field i get the following error: https://flareapp.io/share/v5pKjbM7

Repeater field code:

Forms\Components\Repeater::make('requestTravellers')
                    ->relationship()
                    ->columnSpanFull()
                    ->reorderable(0)
                    ->addActionLabel('Select another Traveller')
                    ->simple(
                        Forms\Components\Select::make('traveller_id')
                            ->relationship(
                                name: 'travellers',
                                titleAttribute: 'first_name',
                                modifyQueryUsing: fn(Builder $query) => $query->where('company_id', Auth::user()->company_id)
                            )
                            ->getOptionLabelFromRecordUsing(fn(Model $record) => "{$record->full_name} | {$record->email}")
                            ->createOptionForm(fn(Form $form) => TravellerResource::form($form))
                            ->required(),
                    )
                    ->grid(2),
Forms\Components\Repeater::make('requestTravellers')
                    ->relationship()
                    ->columnSpanFull()
                    ->reorderable(0)
                    ->addActionLabel('Select another Traveller')
                    ->simple(
                        Forms\Components\Select::make('traveller_id')
                            ->relationship(
                                name: 'travellers',
                                titleAttribute: 'first_name',
                                modifyQueryUsing: fn(Builder $query) => $query->where('company_id', Auth::user()->company_id)
                            )
                            ->getOptionLabelFromRecordUsing(fn(Model $record) => "{$record->full_name} | {$record->email}")
                            ->createOptionForm(fn(Form $form) => TravellerResource::form($form))
                            ->required(),
                    )
                    ->grid(2),


Let me know if you need any more info and thanks in advance!
Flare
Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in /var/www/html/vendor/filament/forms/src/Components/Select.php on line 769 - The error occurred at http://localhost/requests/create
Repeater - Form Builder - Filament
Solution
oh the error on the Select component not the repeater

do you have the relation
travellers
travellers
in
TravellerRequest
TravellerRequest
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Relation Manager with repeater and pivot
FilamentFFilament / ❓┊help
11mo ago
Relation Manager with Pivot and ordering on pivot
FilamentFFilament / ❓┊help
3y ago
Repeater pivot
FilamentFFilament / ❓┊help
3y ago
Repeater with pivot table
FilamentFFilament / ❓┊help
11mo ago