try this,
Platform::with(['rma_platform' => function($query){
$query->select(['connectorname']);
}])->get();
Thanks @AntiKrishnan!, but still not working. If I execute this
Platform::with('rma_platform')->get();
I get the entire relation, so the relation is OK. Any other suggestion?
try mentioning the foreign key in the field list.
Platform::with(['rma_platform' => function($query){
$query->select(['foreign_key','connectorname']);
}])->get();
Like AthiKrishnan said, you need to also select the foreign keys so that Laravel can properly match the relationships.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community