Weave Code
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

Composer Config Plugin Laravel Package

yiisoft/composer-config-plugin

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Modular Configuration Management: Enables a plugin-based architecture where configurations are bundled with Laravel/PHP packages, reducing duplication and improving maintainability. Ideal for large-scale applications with multiple microservices or reusable components.
  • Decoupled Configuration: Supports build vs. buy by allowing teams to package configurations alongside their code, reducing dependency on monolithic config files. Useful for frameworks, libraries, or SaaS platforms where configurations are part of the product offering.
  • Multi-Environment Support: Facilitates environment-specific configurations (e.g., .env, YAML, JSON) without hardcoding values, aligning with 12-factor app principles. Critical for CI/CD pipelines, staging, and production parity.
  • Dynamic Configuration Assembly: Enables runtime flexibility by merging configs from multiple packages (e.g., auth, db, logging) into a single coherent structure. Reduces merge conflicts and simplifies dependency management.
  • Roadmap for Config-Driven Features: Paves the way for feature flags, A/B testing, or tenant-specific settings by treating configs as first-class citizens in the package ecosystem.
  • Debugging and Observability: Provides visibility into config assembly (e.g., composer du -v) to troubleshoot misconfigurations, critical for SRE-driven or DevOps-heavy teams.

When to Consider This Package

  • Avoid if:

    • Your project uses a flat configuration structure (e.g., single config/app.php) with minimal dependencies. Overhead of this plugin may not justify benefits.
    • You’re already using a dedicated config management tool (e.g., Laravel’s built-in config caching, Symfony’s ParameterBag, or Ansible for infrastructure-as-code).
    • Your team lacks Composer maturity or prefers explicit config files over implicit package-based assembly.
    • You need schema validation for configs (this package treats configs as raw arrays; consider yiisoft/config or spatie/laravel-config-array for validation).
  • Adopt if:

    • You’re building a modular PHP/Laravel monolith or microservices where configs are distributed across packages.
    • Your team uses Composer heavily and wants to align configs with dependency management.
    • You need environment-aware configs (e.g., .env for secrets, YAML for multi-tier settings) without manual merging.
    • You’re developing a framework/library and want to ship configs as part of the package (e.g., auth providers, database adapters).
    • You require dynamic config overrides (e.g., local overrides for params-local.php without modifying package files).

How to Pitch It (Stakeholders)

For Executives/Stakeholders:

*"This package lets us treat configurations as first-class citizens in our PHP/Laravel ecosystem—just like code. Instead of manually merging config/*.php files or hardcoding settings, we can package configs with our libraries or microservices. For example:

  • Auth Service: Ships with its own auth.php config, including default providers and rules.
  • Database Layer: Bundles connection configs that override or extend the root app’s settings.
  • CI/CD: Uses .env files for environment-specific values (e.g., APP_DEBUG=true in dev) without polluting the codebase.

This reduces technical debt, speeds up onboarding (new devs get configs "for free"), and makes our system more resilient to changes. It’s like Composer for configs—automated, versioned, and dependency-aware."*

Business Impact:

  • Faster releases: Configs are auto-assembled during composer install, eliminating manual setup.
  • Reduced errors: Clear hierarchy (root configs override package configs) prevents misconfigurations.
  • Scalability: Supports hundreds of packages without config spaghetti.

For Engineering Teams:

*"This plugin solves two key pain points:

  1. Config Hell: No more hunting for which config/*.php file overrides another. The plugin merges configs in a predictable order (root > packages) and supports wildcards (../src/Modules/*/config/web.php) for modular setups.
  2. Environment Parity: Load .env files, YAML, or JSON alongside PHP configs, with runtime overrides (e.g., params-local.php). Perfect for local dev, staging, and production.

How to Use It:

  • Add configs to your composer.json under extra/config-plugin:
    "config-plugin": {
      "envs": ".env",
      "params": ["config/params.php", "?config/params-local.php"],
      "web": ["$params", "config/web.php"]
    }
    
  • Reference configs in code with Yiisoft\Composer\Config\Builder::require('web').
  • Debug with composer dump-autoload --verbose to see the dependency tree.

Trade-offs:

  • Not a replacement for Laravel’s config caching: Use this for package-level configs; Laravel’s cache still handles app-wide configs.
  • Archived but stable: The team recommends yiisoft/config, but this plugin is battle-tested and simpler for basic use cases.
  • Performance: Configs are rebuilt on composer install/update (add composer du to your CI/CD pipeline).

When to Avoid:

  • If you’re using a config management tool like Consul or Etcd, this adds unnecessary complexity.
  • For projects where configs are trivial (e.g., a small Laravel app with 5 config files)."*

Call to Action: "Let’s pilot this for our [Auth Service/Microservice X] to see how it simplifies config management. We’ll compare it to our current approach in a 2-week spike."

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle