byjg/config
A lightweight configuration library for PHP that loads settings from arrays, INI, JSON, YAML, and environment variables, with dot-notation access, defaults, merging, and environment-specific overrides for flexible app configuration.
Definition::addConfigDirectory() delivers layered, multi-directory config loading with merge semantics (later directories override earlier), which is exactly the "ship defaults, let the app override" pattern every framework package re-implements poorly in-house.DependencyInjection API improvements and added validations reduce the likelihood of silent misconfiguration in production — a common source of support tickets and incident toil.Adopt when:
Look elsewhere when:
config/ publishing conventions and do not need multi-directory layered loading — adopting adds a parallel abstraction.Before committing, verify: exact override precedence semantics match our expectations, behavior of deep vs. shallow merges for nested arrays, performance of multi-directory loading at boot, backward-compatibility of the DependencyInjection API changes for any existing consumers, and test coverage for the new merge paths.
For executives: This release lets our PHP/Laravel packages ship with sensible default configuration that customers and internal projects can override cleanly — a small upgrade that removes custom glue code, reduces misconfiguration incidents, and makes our packages easier to adopt and configure. Low integration cost, contained scope, no new vendor dependency.
For engineering: 6.1.0 adds Definition::addConfigDirectory() for layered multi-directory config loading with full merge support (later directories override earlier), enabling the standard "package defaults, project overrides" pattern without bespoke code. It also tightens the DependencyInjection API with improved validations, catching wiring errors earlier. Recommended action: spike adoption in one package, confirm merge/precedence semantics and boot-time cost, then standardize. Watch for any behavior changes in the DI API that affect existing consumers before rollout.
How can I help you explore Laravel packages today?