Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Installer Laravel Package

api-platform/installer

Composer installer for API Platform, the PHP framework for building REST and GraphQL APIs. It streamlines project creation and setup, delivering a ready-to-use application with sensible defaults and minimal configuration for your next API.

View on GitHub
Deep Wiki
Context7

Getting Started

api-platform/installer is not a library you require in an application — it is the Composer plugin that bootstraps a new API Platform project. You interact with it almost exclusively through composer create-project.

Prerequisites: PHP 8.2+, Composer 2.x, and (for the default skeleton) Docker or a local PHP server.

Minimal steps:

composer create-project api-platform/api-platform my-api
cd my-api
docker compose up -d          # or: symfony serve / php -S localhost:8000 -t public

Then open https://localhost/docs for the Swagger UI and https://localhost/api for the entrypoint. The installer has already written .env (APP_SECRET, DATABASE_URL), wired the Docker services, and installed api-platform/core.

Where to look first:

  • composer.json → extra.class / type of the plugin, and the scripts block (post-create-project-cmd).
  • vendor/api-platform/installer/ in the generated project (read the plugin class to see exactly which files it touches).
  • The generated .env, compose.yaml, and config/packages/api_platform.yaml — these are the artifacts the installer produces that you will actually edit day-to-day.

First real use case: scaffolding a throwaway project to inspect the current “blessed” layout before upgrading your own app, or generating a reproducible starter for a team.

Implementation Patterns

  • Scaffold, don't require. Use composer create-project api-platform/api-platform my-api "^4.0" to pin a major version. Never run composer require api-platform/installer in an existing app; it does nothing useful outside the create-project lifecycle.
  • CI / headless bootstrap. Run non-interactively and pre-approve the plugin:
    composer config --global allow-plugins.api-platform/installer true
    COMPOSER_NO_INTERACTION=1 composer create-project api-platform/api-platform my-api --no-scripts=false
    
    Commit the resulting composer.json and composer.lock, not vendor/.
  • Team template pattern. Create the project once, strip the demo src/Entity/src/State examples, commit as an internal template repo, and let teammates clone instead of re-running the installer. This sidesteps installer churn between minor versions.
  • Existing Symfony app. Skip the installer entirely: composer require api-platform/core plus the Flex recipe, then hand-write config/packages/api_platform.yaml and the routes. The installer assumes a clean directory.
  • Inspect before adopting. Run composer create-project api-platform/api-platform my-api --no-install to fetch the skeleton without executing the plugin, then diff its output against a fully installed project to see what the installer contributes.
  • Forking/extending. If you maintain a custom skeleton, declare the same type: composer-plugin + extra.class contract and subscribe to post-create-project-cmd; that is the only extension point the upstream plugin exposes.

Gotchas and Tips

  • Composer 2 only. The plugin targets composer-plugin-api ^2.0; Composer 1 silently skips it and you get a half-configured project.
  • allow-plugins prompts. On Composer 2.2+, create-project may ask to allow the plugin. In non-interactive shells that prompt defaults to “no” and the post-install customization is skipped. Pre-seed allow-plugins globally or pass --no-interaction only after configuring it.
  • It runs once. The installer has no upgrade path. To move an existing app to a newer API Platform, bump api-platform/core with composer update — do not re-run create-project over your code.
  • Partial scaffolds. If the plugin fails mid-run you are left with a directory that looks complete but has an empty APP_SECRET or missing DB env. Delete the directory and retry rather than patching by hand.
  • Debugging. composer create-project -vvv api-platform/api-platform my-api and COMPOSER_DEBUG_EVENTS=1 show plugin/event dispatch. Read vendor/api-platform/installer/src/ to confirm exactly which files it rewrites.
  • APP_SECRET and DB. First boot fails cryptically (bin/console errors, 500s on /api) if .env was not populated. Confirm APP_SECRET and DATABASE_URL before blaming the framework.
  • Docker assumptions. The generated compose.yaml expects specific ports and a PostgreSQL service; on a machine with an existing Postgres on 5432 you must remap.
  • Don't rely on it in production images. It is a developer-time tool; your Dockerfile should build from the committed project, not re-invoke the installer.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core