create option form error

Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in How do i fix
5 Replies
LeandroFerreira
LeandroFerreira14mo ago
share your code please
antiquarian_capsaicin
Thanks very much but I was able to fix it
electronick86
electronick8614mo ago
what was the problem?
Helge Sverre
Helge Sverre13mo ago
Old, but for the sake of solving this for other searchers in the future. The relationship() on the select inside of a repeater that is linked to a pivot table, has to refer to the relationship on the pivot table, not the current model, might be obvious in hindsight, but i confused myself by having a relationship that has almost the same name on the pivot and the root model. In the image i have a SubscriptionPlan which has many Products via a ProductSubscriptionPlan Pivot table where i configure the options for this product on this specific subscription plan. So the product_id selector inside the repeater is meant to use the Pivot table "belongsTo product" relationship, not the "belongsToMany products" on the SubscriptionPlan.
No description
Sagar Gautam
Sagar Gautam2mo ago
I have got the same issue with repeater and many to many relationships 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 765 Can you explain your solution a bit more ?

Did you find this page helpful?