Laravel Forum 3 Documentation

API - Request Scopes

Request Scopes

Request scopes take advantage of regular Eloquent Query Scopes to provide an easy way of adjusting API requests.

Refer to the front-end source for examples of these scopes being implemented programmatically.


GET <endpoint>?where[column]=value

Add a simple WHERE clause to the query.


GET <endpoint>?with[]=relationship

Include the specified relationship(s) in the response. Useful for Eager Loading.


GET <endpoint>?append[]=attribute

Include the specified attribute(s) in the response.


GET <endpoint>?orderBy=column&orderDir=desc

Add a simple ORDER BY to the query.