PHPackages                             imran/laravel-dynamic-config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. imran/laravel-dynamic-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

imran/laravel-dynamic-config
============================

Dynamic runtime configuration system for Laravel applications.

0.0.1(2mo ago)00MITPHPPHP ^8.2

Since May 15Pushed 2mo agoCompare

[ Source](https://github.com/grim-reapper/laravel-dynamic-config)[ Packagist](https://packagist.org/packages/imran/laravel-dynamic-config)[ RSS](/packages/imran-laravel-dynamic-config/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Laravel Dynamic Config 🚀
========================

[](#laravel-dynamic-config-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/092eb0327aa7f29bc0d7233788b9c2d3efbb53d10b5b36822e4ff31cf1771635/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d72616e2f6c61726176656c2d64796e616d69632d636f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imran/laravel-dynamic-config)[![Total Downloads](https://camo.githubusercontent.com/d01400d0113a3ffe200349a89368337864efa3f433b5ebf7f81bdc18186ab7bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d72616e2f6c61726176656c2d64796e616d69632d636f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imran/laravel-dynamic-config)[![License](https://camo.githubusercontent.com/5e74f8aab80bf590adbfee43bba060c718e641cbd1859b6aa84c9fbeae82dd8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696d72616e2f6c61726176656c2d64796e616d69632d636f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imran/laravel-dynamic-config)

**Take control of your Laravel application configuration at runtime.** Load, merge, and override configuration from multiple sources like Databases, YAML, JSON, and PHP files without redeploying your app.

---

🌟 Why Laravel Dynamic Config?
-----------------------------

[](#-why-laravel-dynamic-config)

In modern web applications, configuration often needs to be more than just static `.env` or PHP files. Whether it's white-labeling settings, feature flags stored in a database, or environment-specific overrides in YAML/JSON, managing these can become a nightmare.

### The Problem

[](#the-problem)

- **Deployment Overhead**: Changing a simple config value often requires a full CI/CD pipeline run.
- **Database Settings**: Storing settings in the database but struggling to inject them seamlessly into Laravel's `config()` system.
- **Complexity**: Merging multiple configuration sources manually is error-prone and hard to maintain.

### The Solution

[](#the-solution)

**Laravel Dynamic Config** provides a robust, priority-based configuration engine that hooks directly into Laravel's core. It allows you to define multiple "sources" of truth and merges them intelligently, giving you a unified `config()` API while keeping your application fast with built-in caching.

---

✨ Features
----------

[](#-features)

- 🛠 **Multiple Drivers**: Out-of-the-box support for **Database**, **YAML**, **JSON**, and **PHP**.
- 🧬 **Priority Merging**: Define which source takes precedence. Higher priority sources override lower ones.
- 📦 **Namespace Support**: Load configuration into specific keys (e.g., `services.stripe`) or the root config.
- ⚡ **High Performance**: Custom caching engine ensures your app remains blazing fast.
- 💻 **CLI Power**: Artisan commands for debugging, caching, and clearing configuration.
- 🧩 **Extensible**: Easily add your own custom drivers.

---

🚀 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require imran/laravel-dynamic-config
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Imran\DynamicConfig\DynamicConfigServiceProvider"
```

> **Note**: If you intend to use YAML configurations, ensure you have the symfony/yaml package installed: `composer require symfony/yaml`

### Configuration

[](#configuration)

Define your sources in `config/dynamic-config.php`:

```
return [
    'merge_strategy' => 'deep', // deep, replace, append
    'cache_file' => base_path('bootstrap/cache/dynamic_config.php'),

    'sources' => [
        [
            'driver'   => 'json',
            'priority' => 5,
            'path'     => storage_path('configs/app.json'),
        ],
        [
            'driver'   => 'yaml',
            'priority' => 10,
            'path'     => storage_path('configs/features.yaml'),
        ],
        [
            'driver'   => 'database',
            'priority' => 20,
            'table'    => 'app_configs',
        ],
    ],
];
```

Artisan Commands
----------------

[](#artisan-commands)

### Caching Configurations

[](#caching-configurations)

Because dynamic configurations bypass Laravel's native `config:cache`, you must use this package's cache commands for production performance.

```
php artisan dynamic-config:cache
```

To clear the generated cache:

```
php artisan dynamic-config:clear
```

### Debugging Resolutions

[](#debugging-resolutions)

Ever wonder where a config value came from? Use the debug command to see a resolution tree for a specific key:

```
php artisan dynamic-config:debug app.name
```

**Output:**

```
Inspecting key: app.name

├── json[1]: "My App"
├── yaml[1]: "Enterprise App"
└── final: "Enterprise App"

```

Extending Drivers
-----------------

[](#extending-drivers)

You can easily add your own drivers (e.g., API, Redis, Vault) by creating a class that implements `Imran\DynamicConfig\Contracts\ConfigDriver` and extending the `ConfigManager` inside your `AppServiceProvider`.

```
use Imran\DynamicConfig\ConfigManager;

public function boot()
{
    $this->app->make(ConfigManager::class)->extend('redis', RedisDriver::class);
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance86

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

71d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7252105628ffa6f064585370161626c7c72e68dd2e74ee66aa50d5894543c183?d=identicon)[webz2feel](/maintainers/webz2feel)

---

Top Contributors

[![grim-reapper](https://avatars.githubusercontent.com/u/7957389?v=4)](https://github.com/grim-reapper "grim-reapper (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imran-laravel-dynamic-config/health.svg)

```
[![Health](https://phpackages.com/badges/imran-laravel-dynamic-config/health.svg)](https://phpackages.com/packages/imran-laravel-dynamic-config)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k96.5k1](/packages/mike-bronner-laravel-model-caching)[flarum/core

Delightfully simple forum software.

211.4M2.4k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
