Tooling
Deployment
Compile the definitions for production.
Definitions are compiled on first use. In production, compile them all at deployment:
Terminal
php artisan optimize # runs jsonapi:cache (and revision:cache)
| Command | Effect |
|---|---|
php artisan jsonapi:cache | Compiles every definition, at every revision, into bootstrap/cache/jsonapi.php |
php artisan jsonapi:clear | Removes the compiled definitions (run by optimize:clear) |
The resources are looked for in definitions.paths (the app directory by default).
Run
php artisan jsonapi:check --strict in CI before deploying: a definition that cannot be compiled fails there
rather than on the first request.