Laravel Forum Documentation

3.x — API — 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.

Where

GET <endpoint>?where[column]=value

Add a simple WHERE clause to the query.

With

GET <endpoint>?with[]=relationship

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

Append

GET <endpoint>?append[]=attribute

Include the specified attribute(s) in the response.

Order

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

Add a simple ORDER BY to the query.