class ApiController implements ExtenderInterface
Methods
<p>Set the serializer that will serialize data for the endpoint.</p>
<p>Include the given relationship by default.</p>
<p>Don't include the given relationship by default.</p>
<p>Make the given relationship available for inclusion.</p>
<p>Don't allow the given relationship to be included.</p>
<p>Set the default number of results.</p>
<p>Set the maximum number of results.</p>
<p>Allow sorting results by the given field.</p>
<p>Disallow sorting results by the given field.</p>
<p>Set the default sort order for the results.</p>
<p>Eager loads relationships needed for serializer logic.</p>
Details
at
line 38
__construct(string $controllerClass)
at
line 51
ApiController
prepareDataQuery(callable|string $callback)
at
line 73
ApiController
prepareDataForSerialization(callable|string $callback)
at
line 94
ApiController
setSerializer(string $serializerClass, callable|string|null $callback = null)
<p>Set the serializer that will serialize data for the endpoint.</p>
at
line 115
ApiController
addInclude($name, callable|string|null $callback = null)
<p>Include the given relationship by default.</p>
at
line 136
ApiController
removeInclude($name, callable|string|null $callback = null)
<p>Don't include the given relationship by default.</p>
at
line 157
ApiController
addOptionalInclude($name, callable|string|null $callback = null)
<p>Make the given relationship available for inclusion.</p>
at
line 178
ApiController
removeOptionalInclude($name, callable|string|null $callback = null)
<p>Don't allow the given relationship to be included.</p>
at
line 199
ApiController
setLimit(int $limit, callable|string|null $callback = null)
<p>Set the default number of results.</p>
at
line 220
ApiController
setMaxLimit(int $max, callable|string|null $callback = null)
<p>Set the maximum number of results.</p>
at
line 241
ApiController
addSortField(string|array $field, callable|string|null $callback = null)
<p>Allow sorting results by the given field.</p>
at
line 262
ApiController
removeSortField(string|array $field, callable|string|null $callback = null)
<p>Disallow sorting results by the given field.</p>
at
line 283
ApiController
setSort(array $sort, callable|string|null $callback = null)
<p>Set the default sort order for the results.</p>
at
line 304
ApiController
load(string|string[] $relations)
<p>Eager loads relationships needed for serializer logic.</p>
<p>First level relationships will be loaded regardless of whether they are included in the response. Sublevel relationships will only be loaded if the upper level was included or manually loaded.</p>