docs(laravel): document the metadata dump command#2300
Open
soyuka wants to merge 1 commit into
Open
Conversation
api-platform:metadata:dump and its staleness detection landed in api-platform/core#8290 — the dumped-metadata file is now the recommended way to boot without a database, with the SQLite path kept as a fallback. Refs api-platform/core#8131, api-platform/core#8290
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reworks the Booting Without a Database Connection section of the Laravel guide
(
laravel/index.md) around the newapi-platform:metadata:dumpcommand.Supersedes #2294 (closed; head branch had been deleted, so this is a fresh PR with the same branch).
Why
To expose an Eloquent model, API Platform introspects the live database schema while
building resource metadata at boot, so the app cannot boot without a reachable, migrated
database (
docker build,composer installscripts, Larastan/PHPStan in CI).api-platform/core#8290 adds the proper fix: dump the computed metadata to a single
committable/bakeable file and serve it at boot, bypassing the database.
What the section documents
api-platform:metadata:dump+ themetadata_dumpconfig key; read at boot whenAPP_DEBUG=false, ignored in debug;built-in staleness warnings that catch a forgotten refresh (resource drift at boot,
schema drift after
migrate);Refs api-platform/core#8131, api-platform/core#8290