Skip to content

Commit

Permalink
Use PostResource for conditional relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvdanker committed Feb 22, 2018
1 parent 1199ecd commit c142b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eloquent-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ If you would like to include related resources in your response, you may add the
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'posts' => Post::collection($this->posts),
'posts' => PostResource::collection($this->posts),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
Expand Down

0 comments on commit c142b5d

Please sign in to comment.