Nova adds related "through" records to a hasOne relation without being asked

Viewed 15

I have a Laravel Nova (4.13) Location resource that loads a related Contract resource via a hasOne relation. This Contract resource has its own hasMany Item records, like this:

Location -> Contract -> Item

When I add this to my Location resource:

HasOne::make('Contract'),

it displays a Contracts section, which is expected, but also an Items section below it, which is not. If I remove the Contract field, both sections disappear.

I have another resource that is linked to the same Item records via a different route, and it also pulls in records, so if I pull in both, the Item records for each are brought in too (so I end up with two sets, with the same name). If I do not pull in either of them, the Item records do not appear.

Nova is acting as if I had also specified a HasManyThrough relation to the Item records.

How do I prevent it from doing that?

Failing that, how can I give them different names for each context?

0 Answers
Related