Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc specification of columns in with method #3638

Merged
merged 1 commit into from Sep 14, 2017
Merged

Doc specification of columns in with method #3638

merged 1 commit into from Sep 14, 2017

Conversation

carusogabriel
Copy link
Contributor

Recently I saw a tweet that shows how we can specify columns directly when eager loading a relation:
djoif5awaae_eyo
This PR documents this.

PS: This is my first PR for docs, so sorry about any mistakes! Also, this feature is available since Laravel 5.3, so should we document it for those versions?

@taylorotwell taylorotwell merged commit 2441a98 into laravel:5.5 Sep 14, 2017
@carusogabriel carusogabriel deleted the patch-1 branch September 14, 2017 15:52
@sausin
Copy link

sausin commented Sep 14, 2017

I would think that the docs need to specify that if this is done with a child, the parent id needs to be specified.

i.e.

Author::with('comments:id,text')->get()

will not work but

Author::with('comments:id,author_id,text')->get()

will work (checked in 5.5).

Was PR'd a while back #3179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants