Skip to content

Commit

Permalink
Eager load featured images (#498)
Browse files Browse the repository at this point in the history
Loads in featured images in the Posts component loadPosts method
  • Loading branch information
nizzac authored Apr 20, 2020
1 parent bd99d45 commit f85039b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected function listPosts()
*/
$isPublished = !$this->checkEditor();

$posts = BlogPost::with('categories')->listFrontEnd([
$posts = BlogPost::with(['categories', 'featured_images'])->listFrontEnd([
'page' => $this->property('pageNumber'),
'sort' => $this->property('sortOrder'),
'perPage' => $this->property('postsPerPage'),
Expand Down

0 comments on commit f85039b

Please sign in to comment.