class ApiController implements ExtenderInterface
Methods
Set the serializer that will serialize data for the endpoint.
Include the given relationship by default.
Don't include the given relationship by default.
Make the given relationship available for inclusion.
Don't allow the given relationship to be included.
Set the default number of results.
Set the maximum number of results.
Allow sorting results by the given field.
Disallow sorting results by the given field.
Set the default sort order for the results.
Details
at
line 37
__construct(string $controllerClass)
at
line 50
ApiController
prepareDataQuery(callable|string $callback)
at
line 72
ApiController
prepareDataForSerialization(callable|string $callback)
at
line 86
ApiController
setSerializer(string $serializerClass, callable|string|null $callback = null)
Set the serializer that will serialize data for the endpoint.
at
line 100
ApiController
addInclude(string|array $name, callable|string|null $callback = null)
Include the given relationship by default.
at
line 114
ApiController
removeInclude(string|array $name, callable|string|null $callback = null)
Don't include the given relationship by default.
at
line 128
ApiController
addOptionalInclude(string|array $name, callable|string|null $callback = null)
Make the given relationship available for inclusion.
at
line 142
ApiController
removeOptionalInclude(string|array $name, callable|string|null $callback = null)
Don't allow the given relationship to be included.
at
line 156
ApiController
setLimit(int $limit, callable|string|null $callback = null)
Set the default number of results.
at
line 170
ApiController
setMaxLimit(int $max, callable|string|null $callback = null)
Set the maximum number of results.
at
line 184
ApiController
addSortField(string|array $field, callable|string|null $callback = null)
Allow sorting results by the given field.
at
line 198
ApiController
removeSortField(string|array $field, callable|string|null $callback = null)
Disallow sorting results by the given field.
at
line 212
ApiController
setSort(array $sort, callable|string|null $callback = null)
Set the default sort order for the results.