symfony/config
The Symfony Config component helps you find, load, combine, autofill, and validate configuration values from any source—YAML, XML, INI files, or even a database—giving your PHP applications flexible, reliable configuration handling.
ArrayShapeGenerator and auto-generated config/reference.php, plus deprecating the fluent PHP builder in favor of PHP array config that mirrors YAML shape. If we adopt, standardizing on the array-based config format aligns us with where upstream is spending effort and avoids a migration we'd otherwise pay for twice.Illuminate\Config\Repository (dot-notation arrays, env(), config caching) already covers flat app config. Adding symfony/config is a new configuration paradigm alongside the existing one, so the decision is really "two config systems, clearly scoped" vs. "one, with weaker schema guarantees."Adopt when most of these hold:
.env/env() bridge, no config-repository bridge, and no Laravel-documented path. We own the glue and the docs.Look elsewhere (or defer) when:
config() plus a typed DTO and Laravel's validator is cheaper than standing up a node tree.symfony/config 6.4/7.x — workable (6.4 is LTS, still patched), but you'd be adopting on the deprecated fluent-builder path, and the surrounding docs/tutorials are split across three generations. Decide this up front; it's the single most likely reason this evaluation gets reversed later.symfony/symfony monorepo; this repo is an automated split. We are a consumer, not a stakeholder. If config semantics are core IP, budget for a wrapper layer that isolates us.To executives (one paragraph): This is a free, MIT-licensed, battle-tested configuration library from Symfony — the component that underpins configuration for one of the two dominant PHP frameworks, with a funded foundation, continuous patch releases across an LTS line, and a decade-long track record. It lets us define a strict, documented schema for how our product is configured, then load it from YAML/XML/INI/database, apply defaults automatically, and reject bad input with precise error messages — instead of building and maintaining that machinery ourselves. That directly reduces support load from misconfiguration and shortens onboarding for self-hosted and enterprise customers. The trade-off is honest: it's a genuine engineering dependency requiring integration work in a Laravel codebase, and its latest major requires PHP 8.4, so we'd initially adopt on the 7.x line. Recommendation: adopt for nested, customer-facing config surfaces only, and keep simple app settings on Laravel's native config.
To engineering (summary): Adopt symfony/config as the schema/validation layer for our non-trivial config, not as a replacement for config(). Use TreeBuilder/ArrayNodeDefinition to declare a typed tree (scalars, enums, prototyped arrays, canBeEnabled/canBeDisabled folding), loaders to accept multiple formats, and ConfigCache with resource tracking for invalidation. Standardize on the PHP array config format, not the fluent builder — upstream deprecated the fluent format in 8.0 and is investing in array shapes and generated config/reference.php, and ArrayShapeGenerator gives us PHPStan-ready types for free. Scope it behind our own thin interface so the Symfony types don't leak into domain code, which is also our hedge if we ever need to swap it out. Expect to pin versions per PHP floor and to track the monorepo for changes, since this split repo has no independent roadmap.
How can I help you explore Laravel packages today?