taylorotwell/eloquent — Issue #10: Eager loading for multiple levels in Eloquent [Feature Request]
Author: sqwk
Created: 2012-02-04 13:19:37+00:00
State: open

At the moment Eloquent supports eager loading like so:

$post = Post::with('category', 'comments')->get();

However, it is not possible to eager load multiple levels . A proposed syntax would be:

$posts = Post::with('category', 'comments' => array('author'))->get()

(Migrated from the Laravel repo: https://github.com/laravel/laravel/issues/247#issuecomment-3722303)