Skip to content

docs(laravel): document the metadata dump command#2300

Open
soyuka wants to merge 1 commit into
api-platform:mainfrom
soyuka:docs/laravel-boot-without-database
Open

docs(laravel): document the metadata dump command#2300
soyuka wants to merge 1 commit into
api-platform:mainfrom
soyuka:docs/laravel-boot-without-database

Conversation

@soyuka

@soyuka soyuka commented Jun 13, 2026

Copy link
Copy Markdown
Member

What

Reworks the Booting Without a Database Connection section of the Laravel guide
(laravel/index.md) around the new api-platform:metadata:dump command.

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 install scripts, 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 + the metadata_dump config key; read at boot when
    APP_DEBUG=false, ignored in debug;
  • the dump is a snapshot and must be regenerated after resource/schema changes — and the
    built-in staleness warnings that catch a forgotten refresh (resource drift at boot,
    schema drift after migrate);
  • Docker build and CI static-analysis flows using the committed dump;
  • migrated SQLite at build time kept as a fallback for those who prefer not to commit a file.

Refs api-platform/core#8131, api-platform/core#8290

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant