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>
<p>Allows loading a relationship with additional query modification.</p>
Details
at
line 39
__construct(string $controllerClass)
at
line 52
ApiController
prepareDataQuery(callable|string $callback)
at
line 74
ApiController
prepareDataForSerialization(callable|string $callback)
at
line 95
ApiController
setSerializer(string $serializerClass, callable|string|null $callback = null)
<p>Set the serializer that will serialize data for the endpoint.</p>
at
line 116
ApiController
addInclude($name, callable|string|null $callback = null)
<p>Include the given relationship by default.</p>
at
line 137
ApiController
removeInclude($name, callable|string|null $callback = null)
<p>Don't include the given relationship by default.</p>
at
line 158
ApiController
addOptionalInclude($name, callable|string|null $callback = null)
<p>Make the given relationship available for inclusion.</p>
at
line 179
ApiController
removeOptionalInclude($name, callable|string|null $callback = null)
<p>Don't allow the given relationship to be included.</p>
at
line 200
ApiController
setLimit(int $limit, callable|string|null $callback = null)
<p>Set the default number of results.</p>
at
line 221
ApiController
setMaxLimit(int $max, callable|string|null $callback = null)
<p>Set the maximum number of results.</p>
at
line 242
ApiController
addSortField(string|array $field, callable|string|null $callback = null)
<p>Allow sorting results by the given field.</p>
at
line 263
ApiController
removeSortField(string|array $field, callable|string|null $callback = null)
<p>Disallow sorting results by the given field.</p>
at
line 284
ApiController
setSort(array $sort, callable|string|null $callback = null)
<p>Set the default sort order for the results.</p>
at
line 305
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>
at
line 325
ApiController
loadWhere(string $relation, callable $callback)
<p>Allows loading a relationship with additional query modification.</p>