vendredi 3 mars 2017

laravel eloquent orm - limit columns in eager loading query?

I'm trying to do a eager loading query of a table that has a one-to-many to another table.

So initially, I'm doing this:

    $node = $this->MapNodes()->where('type_id', $typeId )->with('NodeCounters')->first();

This works, but the problem is that table on the far side of the relationship has a LOT of columns, which really bloats the result. Is there a way I can limit/specify the table columns retrieved on the far side of the relationship?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire