egeriis / laravel-jsonapi

Make it a breeze to create a jsonapi.org compliant APIs with Laravel 5.
MIT License
146 stars 27 forks source link

Ability to automatically expose relations for a resource #13

Closed ninjapenguin closed 9 years ago

ninjapenguin commented 9 years ago

As per specification a resource may choose to expose relations within a links node (this happens currently when including a relation)

This PR adds an attribute to the model which enables a resource to identify relations it wishes to expose via the links permanently (when no include is specified).

This identifies the resource within the links node but DOES NOT include the relation.

http://jsonapi.org/format/#document-structure-resource-relationships

egeriis commented 9 years ago

Great addition, thank you!