Support the ongoing development of →
posted 8 years ago
Last updated 6 months ago.

I forgot to mention that I've tried with propertyStatus.status, property_status.status, but with no result...

Last updated 6 months ago.

In this case where you are just retriving one single property model with all one-one relations, why are you lazy-loading ?

I mean, lazy loading or not, the number of queries will be anyway 4 !

If not can you give a view of your schema.

Last updated 6 months ago.

It eager loading, by the definition from here:

Besides, the result that I'm returning to the user in through API and is in JSON format and that's why I need to select only certain columns and not all of them.

Last updated 6 months ago.

I'll redefine my question, in case I was not clear. This example is from the Query Builder documentation:

            ->join('contacts', '', '=', 'contacts.user_id')
            ->join('orders', '', '=', 'orders.user_id')
            ->select('', '', 'orders.price')

Can I select specific columns like that using Eloquent?

            with('contacts', 'orders')->
            get(array('', '', 'orders.price')->toArray();

I saw that it can be done using closure, but it can get messy if we have more joins using with().

Last updated 6 months ago.

I need that function as well. Would it be difficult to implement?

Last updated 6 years ago.

Sign in to participate in this thread!


Your banner here too?

andrejmk andrejmk Joined 28 Mar 2014


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

Your logo here?

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

© 2022 - All rights reserved.