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),


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
Solution
oh the error on the Select component not the repeater

do you have the relation travellers in TravellerRequest
Was this page helpful?