Reference

Configuration

Every key of config/jsonapi.php.

Publish the file with php artisan vendor:publish --provider="Ark4ne\JsonApi\Laravel\JsonApiServiceProvider" --tag=config. It is validated at boot: a wrong value throws InvalidConfigurationException naming the key.

describer

describer.nullable
bool
Values are nullable unless ->nullable(false). Default true.
describer.precision
int|null
Decimals a float() is rounded to unless ->precision() gives one. Default null: left as it is.
describer.when-has
bool|string[]
Applies whenHas() automatically: true, or the scopes ['attributes', 'resource-meta', 'meta']. Default false.

type

type.naming
string|class-string
The type of a resource without toType() nor #[JsonApiType]: kebab-singular (default), kebab-plural, snake-plural, or a class implementing Ark4ne\JsonApi\Configuration\TypeNaming.

relationship

relationship.linkage
'always'|'loaded'|'included'
When a relationship that is not included renders its data. Default always. See Linkage.

fields

fields.relationships
'filter'|'keep'
fields[type] restricts the relationships too (filter, the specification) or not (keep, the behaviour of 1.x). Default filter.

include

include.max-depth
int|null
Deepest include path accepted; nothing deeper is loaded nor rendered. Default null: no limit.

definitions

definitions.paths
string[]
Where jsonapi:cache and jsonapi:check look for resources. Default []: the app directory.

rendering

rendering.stages
class-string[]
Ark4ne\JsonApi\Rendering\Stage classes run after those of the package, for every resource object. Default [].

errors

errors.renderers
class-string[]
Ark4ne\JsonApi\Http\Errors\ErrorRenderer classes of the application. Default []. See Errors.

document

document.jsonapi
array|false
The top-level jsonapi member: version (1.1), ext, profile, meta. false leaves it out. Its ext are the extensions accepted by the content negotiation.

Set in config/revisions.php

The format of a date and time (date_time_format), the strictness of the values (strict_values) and the revisions (enum, resolvers) belong to ark4ne/laravel-api-revisions. The keys describer.datetime, describer.strict and describer.types of 2.x are refused.