Relationship of a relationship in $this->crud->addColumn() #374
-
Hello! I’ve got 3 entities such as:
It’s easy to get the Purchase date with a relationship column, like this:
But is there a way to get the Retailer name, a.k.a. a field related to the Relationship entity ?
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
OK, I think I've found the answer by myself :-) Apparently, there's no use in using the
Please correct me if I'm wrong :-) |
Beta Was this translation helpful? Give feedback.
Hey @cl3rO3Y not wrong, but you should take into consideration that you should be eager loading those relations on those models.
Otherwise you may run into issues by performing excessive amounts of queries.
Backpack automatically eager loads relationship columns, so you probably better with:
$this->crud->addColumn('purchase.retailer.name')
Cheers