Skip to content

Commit

Permalink
Update eloquent-resources.md
Browse files Browse the repository at this point in the history
Adds a note about the automatic default behaviour around collections and the singular associated resource class.
  • Loading branch information
r3oath authored Sep 17, 2018
1 parent 8d12051 commit 6d138a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eloquent-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ After defining your resource collection, it may be returned from a route or cont
return new UserCollection(User::all());
});

> {note} Collections will automatically utilise any singular resources defined (a resource class matching the start of the collection class name, e.g.: `JokeCollection` will try to match `Joke`.) If you wish to define what singular resource should be used instead of this default behaviour you can define `$this->collects` from within your collection class.
<a name="writing-resources"></a>
## Writing Resources

Expand Down

0 comments on commit 6d138a6

Please sign in to comment.