Repeater relationship failing as it returns null

I have this weird error - I have a relationship called "contributors" and a repeater block for my articles. The error is as below:

Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in .../vendor/filament/forms/src/Components/Select.php on line 774


The error stems from this:

Repeater::make('contributors')
    ->hiddenLabel()
    ->required(fn (Get $get) => !!$get('published'))
    ->relationship()
    ->columns(10)
    ->reorderable()
    ->defaultItems(0)
    ->schema([...])


Note that if I remove the relationship() method, it works fine. And here's the relationship defined on my Article model:

public function contributors(): HasMany
{
    return $this->hasMany(Contributor::class);
}


I'm not sure what's going on here, as there's nothing wrong with that.
Was this page helpful?