Support the ongoing development of Laravel.io →
posted 8 years ago
Eloquent
Last updated 2 years ago.
0

try this,

Platform::with(['rma_platform' => function($query){
    $query->select(['connectorname']);
}])->get();
Last updated 8 years ago.
0

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?

0

try mentioning the foreign key in the field list.

Platform::with(['rma_platform' => function($query){
    $query->select(['foreign_key','connectorname']);
}])->get();
0

Like AthiKrishnan said, you need to also select the foreign keys so that Laravel can properly match the relationships.

0

Thanks @AthiKrishnan, it works!!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

hfuccillo hfuccillo Joined 20 Oct 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.