daftspunk/laravel-config-writer
A Laravel package for writing configuration files at runtime. Update config values programmatically and persist them back to your config files with a simple API, so you can manage dynamic settings without editing PHP files by hand. Handy for admin panels and settings screens.
config/*.php (mail driver, queue, cache, third-party API keys, feature toggles) instead of forcing users to SSH in and edit files — a common ask in self-hosted and on-prem products.composer require and a thin service wrapper.Consider it when:
config/*.php.config/ directory, no immutable container images) and can tolerate clearing the config cache after a write.Look elsewhere when:
config:cache is part of your deploy. Runtime writes are invisible until the cache is rebuilt; you must call config:clear/config:cache after every save, which is fragile and slow. If that coupling is unacceptable, use a database-backed settings package (e.g. spatie/laravel-settings) and read through config.To executives: This is a small, low-cost dependency that unblocks a frequently requested capability — letting customers configure the product from the UI instead of editing files on the server. Integration cost is roughly a one-day spike; the package is MIT-licensed and niche (176 stars). The trade-off is maintenance risk: it hasn't shipped since August 2023, so I'd recommend a time-boxed spike, a pinned version, and a documented fallback to database-backed settings if it breaks. Upside is limited to our self-hosted/on-prem track — it does not advance the multi-tenant cloud roadmap, so I'd fund it as a scoped enabler, not a strategic bet.
To engineering: It solves the annoying part — writing PHP config arrays back to disk while preserving comments, ordering, and formatting — so we don't hand-roll a tokenizer. Two non-negotiables if we adopt it: (1) every write must be followed by config cache invalidation, and (2) we wrap it behind our own SettingsWriter interface so we can swap in a DB-backed implementation later without touching call sites. Please confirm Laravel 11/12 compatibility and file-permission behavior in our deployment target during the spike.
How can I help you explore Laravel packages today?