Skip to content

Commit

Permalink
Merge pull request #67 from uibar/patch-1
Browse files Browse the repository at this point in the history
Update README for proper eager loading
  • Loading branch information
rtconner committed Sep 11, 2015
2 parents 372e943 + 357a546 commit b534c0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class Article extends \Illuminate\Database\Eloquent\Model {
#### Quick Sample Usage

```php
$article = Article::with('tagged')->first(); // eager load
$article = Article::with(['tagged' => function($query) {
$query->with('tag');
}])
->first(); // eager load

foreach($article->tagged as $tagged) {
echo $tagged->tag_name . ' with url slug of ' . $tagged->tag_slug;
Expand Down

0 comments on commit b534c0e

Please sign in to comment.