you can bed one by passing a closure function in with() as second index of an argument array I believe...
Try this:
Post::with(array('user'=>function($query){
$query->select('id','username');
}))->get();
This should retrieve the necessary results if the code is solid, the id is absolutely necessary to retrieve the singled out column though, so make sure to include that.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community