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

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

cryental/laravel-dynamic-config
===============================

This Package makes it possible for users to have their config files stored in a database table, making it easier to customize these values from UI.

1.1(1y ago)08MITPHP

Since May 30Pushed 1y agoCompare

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

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

Larvel Dynamic Config
=====================

[](#larvel-dynamic-config)

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

[](#introduction)

This Package makes it possible for users to have their config files stored in a database table, making it easier to customize these values from UI.

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

[](#installation)

You can install the package via composer:

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

The package will automatically register itself.

You can publish the config with:

Config file:

```
php artisan vendor:publish --provider="EmadHa\DynamicConfig\ServiceProvider" --tag="config"
```

Migration:

```
php artisan vendor:publish --provider="EmadHa\DynamicConfig\ServiceProvider" --tag="migrations"
```

Usage
-----

[](#usage)

First of all, you need to decide which config file(s) you want them to be stored in database by adding `'dynamic'=> true` to the file, as simple as that:

```
# /config/app.php
return [
    'dynamic' => true,
     ...
];
```

> - Note that `dynamic` indicator is defined in `/config/emadha/dynamic-conf.php`:
> - You can add `dynamic=>true` to any config file to store it in database and fetch the values from there instead of using the actual config file
> - The values defaults will be taken from the actual config file.
> - You can have more than one config file loaded dynamically
> - `dynamic=>true` can only be added in the first dimension of that config array.

The main config file of this packages is located in `/config/emadha/dynamic-conf.php` and contains the following code:

```
