chillerlan/php-settings-container
Lightweight PHP settings container to keep configuration logic out of your app (not a DI container). Provides a SettingsContainerInterface with “property hook”-style access for PHP < 8.4, plus sane defaults for organizing and retrieving settings objects.
Adopt When:
#[ThrowOnInvalidProperty]).Look Elsewhere If:
config/ system may suffice).For Executives: "This package lets us manage app settings as structured, immutable objects—like a database table for configs but with validation and transformation logic built in. For example, we could store feature flags with auto-hashing for security, or combine settings from multiple third-party libraries into one clean object. It reduces tech debt by avoiding custom config solutions and aligns with our move to PHP 8.4. Low risk (MIT license, active maintenance), high reward for maintainability."
For Engineers: *"This replaces ad-hoc config arrays with a type-safe, composable settings container. Key benefits:
set_api_key() to hash values) via traits from any library.config('services.stripe.key') with $settings->stripeKey where stripeKey auto-hashes on assignment. Less boilerplate, more safety."*For PMs: "This supports our roadmap for dynamic configurations (e.g., feature flags, environment-specific rules) without bloating the codebase. It’s a lightweight alternative to reinventing a config system, and the trait-based approach lets us reuse logic across projects. Prioritize if we’re adding runtime-configurable features or consolidating scattered config files."
How can I help you explore Laravel packages today?