Created
August 23, 2016 05:11
-
-
Save mehranhadidi/121657d213d97ea77bf3c93a852de205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eager load in laravel new way | |
$post = Post::find(1); | |
$post->load('comments.owner'); // will load the post + comments (relationship) + owner (relationship) | |
return $post; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment