abstract class AbstractDatabaseResource extends AbstractResource implements Findable, Listable, Countable, Paginatable, Creatable, Updatable, Deletable
Traits
Properties
| protected JsonApi | $api | from Bootable |
|
|
| protected Dispatcher | $events | from Bootable |
|
|
| protected Factory | $validation | from Bootable |
|
|
| static protected array | $endpointModifiers | from Extendable |
|
|
| static protected array | $fieldModifiers | from Extendable |
|
|
| static protected array | $sortModifiers | from Extendable |
|
|
| protected array|null | $cachedEndpoints | from Extendable |
|
|
| protected array|null | $cachedFields | from Extendable |
|
|
| protected array|null | $cachedSorts | from Extendable |
|
Methods
from Bootable
Factory
validationFactory()
Called by the JSON:API server package to resolve the validation factory.
from Bootable
void
dispatchEventsFor(mixed $entity, User|null $actor = null)
Dispatch all events for an entity.
from DispatchEventsTrait
Details
Factory
validationFactory()
Called by the JSON:API server package to resolve the validation factory.
in Extendable
at
line 22
static void
mutateEndpoints(callable $modifier)
in Extendable
at
line 27
static void
mutateFields(callable $modifier)
in Extendable
at
line 32
static void
mutateSorts(callable $modifier)
in Extendable
at
line 37
array
resolveEndpoints(bool $earlyResolution = false)
in Extendable
at
line 56
array
resolveFields()
in Extendable
at
line 75
array
resolveSorts()
in HasSortMap
at
line 16
array
sortMap()
in DispatchEventsTrait
at
line 19
void
dispatchEventsFor(mixed $entity, User|null $actor = null)
Dispatch all events for an entity.
in AbstractResource
at
line 30
string|null
id(Context $context)
in AbstractResource
at
line 35
string|null
routeNamePrefix()
at
line 43
abstract string
model()
at
line 49
string|null
resource(object $model, Context $context)
at
line 64
string
getId(object $model, Context $context)
at
line 73
mixed
getValue(object $model, Field $field, Context $context)
at
line 86
protected mixed
getAttributeValue(Model $model, Field $field, Context $context)
at
line 116
protected mixed
getRelationshipValue(Model $model, Relationship $field, Context $context)
at
line 161
object
query(Context $context)
at
line 176
void
scope(Builder $query, Context $context)
Hook to scope a query for this resource.
at
line 184
iterable
results(object $query, Context $context)
at
line 196
void
paginate(object $query, OffsetPagination $pagination)
at
line 205
int|null
count(object $query, Context $context)
at
line 217
object|null
find(string $id, Context $context)
at
line 227
void
setValue(object $model, Field $field, mixed $value, Context $context)
at
line 263
void
saveValue(object $model, Field $field, mixed $value, Context $context)
at
line 279
object
create(object $model, Context $context)
at
line 290
object
update(object $model, Context $context)
at
line 301
protected void
saveModel(Model $model, Context $context)
at
line 310
void
delete(object $model, Context $context)
at
line 318
protected string
property(Field $field)
Get the model property that a field represents.
at
line 326
protected string
method(Field $field)
Get the model method that a field represents.
at
line 332
object
newModel(Context $context)
at
line 337
final array
filters()
Filters that can be applied to the resource list.