Fetch specific fields on a hasMany relation
问题 I have a hasMany relation function like this: public function articles() { return $this->hasMany('App\Article'); } And use it like this: $data = \App\User::with('articles')->get(); I don't have any problems with it, since it's returning the expected data. Something like this: { "id": 1, "name": "Jhon", "lastname": "Doe", "articles": [ { "id": 1, "title": "Article 1", "status": "published", "published_at": "2015-04-30" }, { "id": 2, "title": "Article 2", "status": "draft", "published_at": null