SyntaxFix
Write A Post
Hire A Developer
Questions
This Way:
Post::with(array('user'=>function($query){ $query->select('id','username'); }))->get();