laminas/laminas-config-aggregator
A Laminas package that aggregates configuration from multiple sources—PHP files, arrays, and modules—into a single merged config, with support for caching, glob patterns, and post-processing hooks for use in Laminas and Mezzio applications.
laminas-config, YAML/JSON/XML/INI) with deterministic precedence — later entries win. That directly supports roadmap decisions around config layering: base defaults → environment overlays → tenant/customer overrides → secret injection. If your roadmap includes per-tenant or per-region configuration variants, this is the composition primitive you'd otherwise hand-roll.config/*.php glob loader with array_replace_recursive, plus a homegrown cache writer. This package is ~a few hundred lines of well-tested code that already handles glob portability (FreeBSD, IBM i), deduplication of providers, provider preprocessing, post-processors, and cached bootstrap. Buying is the defensible call unless config composition is itself a differentiator.ParameterBag-style. That unlocks a product decision to stop duplicating values (e.g., single source of truth for a service URL referenced by three subsystems) rather than a per-team convention.Consider it when most of the following are true:
*.global.php per module, plus environment-specific overrides.laminas-stdlib (glob compatibility), brick/varexporter (cache export), and optionally laminas-config for non-PHP formats.Look elsewhere when:
.env loading, config:cache, and Config::get() with dot notation. Introducing this package creates two competing config systems, two caching stories, and a confusing onboarding path. The honest recommendation for a Laravel codebase is to use Laravel's config layer and not add this.To executives — the one-paragraph version: We have a decision to make about how application configuration is assembled and cached. Today this is either ad hoc per service or owned by whichever engineer wrote the loader. This package is a small, actively maintained, permissively licensed (BSD-3-Clause) library that makes config composition explicit, ordered, and cacheable, and it is kept current with PHP releases. Adopting it standardizes a piece of infrastructure that every service touches, reduces duplicate values across config files, and gives us a documented place to improve cold-start performance. It is a buy, not build, and the cost is one small dependency with two transitive libraries. The main caveat is that it is a Laminas-ecosystem tool: for our Laminas/Mezzio services this is a natural fit; for Laravel services it would duplicate existing framework capability and I do not recommend it there.
To engineering — what I'm actually committing us to:
Ask: approve a time-boxed spike on one non-Laravel service to measure bootstrap latency with and without the config cache, then decide on broader rollout based on that number.
How can I help you explore Laravel packages today?