Aug 12, 2022
0
Level 2
Nova extra relations in pivots?
I have a pivot table that uses a custom class and has a few extra fields, including one extra relation. I'm connecting to it from one side of the many:many in a Nova resource like this:
BelongsToMany::make('Products')
->fields(function ($request, $relatedModel) {
return [
Boolean::make('is_carrier'),
BelongsTo::make('Orderable'),
];
})
However, while it works fine for the boolean, as soon as I put that BelongsTo relation in, it hangs indefinitely. Am I doing this wrong, or doesn't Nova support this?
The relations in my models specify the custom class for the pivot (with using()), but I'm not clear whether Nova gets to see that or whether I need to tell it separately.
Please or to participate in this conversation.