class Delete extends Endpoint

Traits

HasMeta
HasVisibility
FindsResources
This is directed at eager loading relationships apart from the request includes.
HasMeta
IncludesData
HasVisibility

Properties

protected array<string| callable> $loadRelations from HasEagerLoading
protected array<string, callable> $loadRelationWhere from HasEagerLoading
protected bool| Closure $authenticated from HasAuthorization
protected null|string| Closure $ability from HasAuthorization
protected bool $admin from HasAuthorization
protected array $before from HasHooks
protected array $after from HasHooks
protected Closure|null $extractFilterCallback from ExtractsListingParams
protected Closure|null $extractSortCallback from ExtractsListingParams
protected Closure|null $extractLimitCallback from ExtractsListingParams
protected Closure|null $extractOffsetCallback from ExtractsListingParams
int|null $limit from ExtractsListingParams
int $maxLimit from ExtractsListingParams
string|null $defaultSort from ExtractsListingParams
string $method from Endpoint
string $path from Endpoint
protected Closure|null $action from Endpoint
protected Closure|null $response from Endpoint
protected array $beforeSerialization from Endpoint

Methods

array
showResource( Context $context, mixed $model)

No description

eagerLoad(array|string| Closure $relations)

Eager loads relationships needed for serializer logic.

eagerLoadWhenIncluded(array $includedToRelations)

Eager load relations when a relation is included in the serialized response.

eagerLoadWhere(string $relation, callable $callback)

Allows loading a relationship with additional query modification.

void
loadRelations( Collection $models, Context $context, array $included = [])

Eager loads relationships before serialization.

array
compileSimpleEagerLoads( Context $context, array $included)

No description

array
compileWhereEagerLoads( Context $context)

No description

array
getEagerLoadsFor(string $included, Context $context)

No description

array
getWhereEagerLoadsFor(string $included, Context $context)

The constrained eager loads beneath a relationship the serializer is loading, for `with()` on its query: keyed by the path below it, with their constraints, as compileWhereEagerLoads() gives the top level.

authenticated(bool| Closure $condition = true)

No description

can(null|string| Closure $ability)

No description

admin(bool $admin = true)

No description

bool
getAuthenticated( Context $context)

No description

string|null
getAuthorized( Context $context)

No description

bool
isVisible( Context $context)

No description

before(callable|string $callback)

No description

from HasHooks
after(callable|string $callback)

No description

from HasHooks
callable
resolveCallable(callable|string $callable, Context $context)

No description

from HasHooks
void
callBeforeHook( Context $context)

No description

from HasHooks
mixed
callAfterHook( Context $context, mixed $data)

No description

from HasHooks
limit(int $limit)

No description

maxLimit(int $maxLimit)

No description

array
extractFilterValue( Context $context, array $defaultExtracts)

No description

array|null
extractSortValue( Context $context, array $defaultExtracts)

No description

int|null
extractLimitValue( Context $context, array $defaultExtracts)

No description

int
extractOffsetValue( Context $context, array $defaultExtracts)

No description

array
defaultExtracts( Context $context)

No description

array
getAvailableSorts( Context $context)

No description

__construct(string $name)

No description

from Endpoint
static  Endpoint
make(string|null $name = null)

No description

void
setUp()

No description

name(string $name)

No description

from Endpoint
action( Closure $action)

No description

from Endpoint
response( Closure $response)

No description

from Endpoint
route(string $method, string $path)

No description

from Endpoint
beforeSerialization( Closure $callback)

No description

from Endpoint
mixed
process( Context $context)

No description

from Endpoint
ResponseInterface|null
handle( Context $context)

No description

from Endpoint

Details

protected array showResource( Context $context, mixed $model)

Parameters

Context $context
mixed $model

Return Value

array

HasEagerLoading eagerLoad(array|string| Closure $relations)

Eager loads relationships needed for serializer logic.

Parameters

array|string| Closure $relations

Return Value

HasEagerLoading

HasEagerLoading eagerLoadWhenIncluded(array $includedToRelations)

Eager load relations when a relation is included in the serialized response.

Parameters

array $includedToRelations An array of included relation to relations to load 'includedRelation' => ['relation1', 'relation2']

Return Value

HasEagerLoading

HasEagerLoading eagerLoadWhere(string $relation, callable $callback)

Allows loading a relationship with additional query modification.

Parameters

string $relation : Relationship name, see load method description.
callable $callback The callback to modify the query, should accept: - \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $query: A query object. - Context $context: An instance of the API context. - array $relations: An array of relations that are to be loaded.

Return Value

HasEagerLoading

protected void loadRelations( Collection $models, Context $context, array $included = [])

Eager loads relationships before serialization.

Parameters

Collection $models
Context $context
array $included

Return Value

void

protected array compileSimpleEagerLoads( Context $context, array $included)

Parameters

Context $context
array $included

Return Value

array

protected array compileWhereEagerLoads( Context $context)

Parameters

Context $context

Return Value

array

array getEagerLoadsFor(string $included, Context $context)

Parameters

string $included
Context $context

Return Value

array

array getWhereEagerLoadsFor(string $included, Context $context)

The constrained eager loads beneath a relationship the serializer is loading, for `with()` on its query: keyed by the path below it, with their constraints, as compileWhereEagerLoads() gives the top level.

Parameters

string $included
Context $context

Return Value

array

HasAuthorization authenticated(bool| Closure $condition = true)

Parameters

bool| Closure $condition

Return Value

HasAuthorization

HasAuthorization can(null|string| Closure $ability)

Parameters

null|string| Closure $ability

Return Value

HasAuthorization

HasAuthorization admin(bool $admin = true)

Parameters

bool $admin

Return Value

HasAuthorization

bool getAuthenticated( Context $context)

Parameters

Context $context

Return Value

bool

string|null getAuthorized( Context $context)

Parameters

Context $context

Return Value

string|null

bool isVisible( Context $context)

Parameters

Context $context

Return Value

bool

Exceptions

NotAuthenticatedException
PermissionDeniedException

HasHooks before(callable|string $callback)

Parameters

callable|string $callback

Return Value

HasHooks

HasHooks after(callable|string $callback)

Parameters

callable|string $callback

Return Value

HasHooks

protected callable resolveCallable(callable|string $callable, Context $context)

Parameters

callable|string $callable
Context $context

Return Value

callable

void callBeforeHook( Context $context)

Parameters

Context $context

Return Value

void

mixed callAfterHook( Context $context, mixed $data)

Parameters

Context $context
mixed $data

Return Value

mixed

ExtractsListingParams limit(int $limit)

Parameters

int $limit

Return Value

ExtractsListingParams

ExtractsListingParams maxLimit(int $maxLimit)

Parameters

int $maxLimit

Return Value

ExtractsListingParams

ExtractsListingParams extractFilter( Closure $callback)

Parameters

Closure $callback

Return Value

ExtractsListingParams

ExtractsListingParams extractSort( Closure $callback)

Parameters

Closure $callback

Return Value

ExtractsListingParams

ExtractsListingParams extractLimit( Closure $callback)

Parameters

Closure $callback

Return Value

ExtractsListingParams

ExtractsListingParams extractOffset( Closure $callback)

Parameters

Closure $callback

Return Value

ExtractsListingParams

array extractFilterValue( Context $context, array $defaultExtracts)

Parameters

Context $context
array $defaultExtracts

Return Value

array

array|null extractSortValue( Context $context, array $defaultExtracts)

Parameters

Context $context
array $defaultExtracts

Return Value

array|null

int|null extractLimitValue( Context $context, array $defaultExtracts)

Parameters

Context $context
array $defaultExtracts

Return Value

int|null

int extractOffsetValue( Context $context, array $defaultExtracts)

Parameters

Context $context
array $defaultExtracts

Return Value

int

array defaultExtracts( Context $context)

Parameters

Context $context

Return Value

array

array getAvailableSorts( Context $context)

Parameters

Context $context

Return Value

array

__construct(string $name)

Parameters

string $name

static Endpoint make(string|null $name = null)

Parameters

string|null $name

Return Value

Endpoint

void setUp()

Return Value

void

Endpoint name(string $name)

Parameters

string $name

Return Value

Endpoint

Endpoint action( Closure $action)

Parameters

Closure $action

Return Value

Endpoint

Endpoint response( Closure $response)

Parameters

Closure $response

Return Value

Endpoint

Endpoint route(string $method, string $path)

Parameters

string $method
string $path

Return Value

Endpoint

Endpoint beforeSerialization( Closure $callback)

Parameters

Closure $callback

Return Value

Endpoint

mixed process( Context $context)

Parameters

Context $context

Return Value

mixed

ResponseInterface|null handle( Context $context)

Parameters

Context $context

Return Value

ResponseInterface|null