PHPackages                             painlesscode/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. painlesscode/laravel-dynamic-config

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

painlesscode/laravel-dynamic-config
===================================

A laravel package to control configuration dynamically

v1.0.1(5y ago)11.1kMITPHP

Since Nov 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/painlesscode/laravel-dynamic-config)[ Packagist](https://packagist.org/packages/painlesscode/laravel-dynamic-config)[ RSS](/packages/painlesscode-laravel-dynamic-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

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

[](#laravel-dynamic-config)

[![PHP Composer test](https://github.com/painlesscode/laravel-dynamic-config/workflows/PHP%20Composer/badge.svg)](https://github.com/painlesscode/laravel-dynamic-config/actions?query=workflow%3A%22PHP+Composer%22)[![License](https://camo.githubusercontent.com/d5a5026f51d8fffa44e2a51d63a601d11c7a9f813182d71bded1f0fb38e17401/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7061696e6c657373636f64652f6c61726176656c2d64796e616d69632d636f6e666967)](https://github.com/painlesscode/laravel-dynamic-config/blob/master/license.md)

Introduction
------------

[](#introduction)

This Package allow users to have their configuration stored in database, makes it easy to customize. Support cache for faster access.

Installation
------------

[](#installation)

You can install the package via composer:

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

publish the config with:

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

Usage
-----

[](#usage)

You just need to decide which config file(s) you want them to be dynamically editable by appending file name to `dynamic_configs` array :

```
# /config/dynamic_config.php
return [
    'dynamic_configs' => [
        'mail',
    ],
];
```

> - `mail` is added at `dynamic_config` array for testing purpose. You are free to remove it, if you don't need it.
> - The default values will be taken from the actual config file.
> - Adding `dynamic_config` to the `dynamic_configs` array have no effect.
> - You can enable cache for faster access. To enable cache dynamic configuration. just edit `enable_cache` key of `dynamic_config.php` file to `true`.
> - Cache file will be stored at `bootstrap/cache/dynamic_config.php` file. You can change the cache file name by editing `cache_file_name` key of of `dynamic_config.php` file.

#### Getting Dynamic Config Value

[](#getting-dynamic-config-value)

```
echo config('mail.default');
// Will return the value of dynamic mail.default (if mail is already added to dynamic_configs array);
```

#### Getting Original Config Value

[](#getting-original-config-value)

```
echo config('defailt.mail.default');
// Will return the value of original configuration (if default_prefix is set to 'default');
```

#### Setting Dynamic Config Value

[](#setting-dynamic-config-value)

```
config('mail.default', 'array');
// It is like default laravel config set. it will be set but persists in only current request.

// to set value permanently
use Painless\DynamicConfig\Facades\DynamicConfig;

// or you can use DynamicConfig Alias

DynamicConfig::set('mail.default', 'ses');
// It will save the value and persist it in database and cache (if enabled)
```

#### Revert config value

[](#revert-config-value)

to revert a config value to its original state:

```
use Painless\DynamicConfig\Facades\DynamicConfig;
// or you can use DynamicConfig Alias

DynamicConfig::revert('mail.default', 'ses');
// It will revert the config value to its original state and persist it.
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Every ~14 days

Total

2

Last Release

1980d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58568fa7d0feb67f115c93f7ef63b793e277d332f0d802df6123e5f2ce41096c?d=identicon)[hazzaz](/maintainers/hazzaz)

---

Top Contributors

[![HazzazBinFaiz](https://avatars.githubusercontent.com/u/29161993?v=4)](https://github.com/HazzazBinFaiz "HazzazBinFaiz (16 commits)")

---

Tags

configurationlaravel

### Embed Badge

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

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

PHPackages © 2026

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