Search code examples
laravelvoyager

Relationships "has-one-through" alternative solution Laravel Voyager


I need to make a relation "has-one-through" but Voyager doesnt support it

The "Consum view" have to show the owner name.

https://i.sstatic.net/nFIph.jpg (DB Example)

I've already tried belongsToMany with pivot table but didn`t work!

Show a column from the requested table.


Solution

  • Why don´t you change your relation, having an owner_id or a house_id instead of an owner_house_id in the consum table? Probably that solves it all.