PHPackages                             apt-getyou/db-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. apt-getyou/db-config

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

apt-getyou/db-config
====================

Laravel Config with DB-storage support

v2.0.2(10y ago)037MITPHPPHP &gt;=5.4.0

Since May 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/apt-getyou/dbConfig)[ Packagist](https://packagist.org/packages/apt-getyou/db-config)[ RSS](/packages/apt-getyou-db-config/feed)WikiDiscussions master Synced 2mo ago

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

Laravel 5 Config with DB-storage support
========================================

[](#laravel-5-config-with-db-storage-support)

This package extends default laravel Config, so fallback capability is built in

### For Laravel 4, please use the [1.\* branch](https://github.com/TerbiumLibs/dbConfig/tree/1.0)!

[](#for-laravel-4-please-use-the-1-branch)

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

[](#installation)

Require this package in your composer.json:

```
"apt-getyou/db-config": "2.*"
```

And add the ServiceProvider to the providers array in app/config/app.php

```
'Terbium\DbConfig\DbConfigServiceProvider',
```

Publish config and migrations using artisan CLI.

```
php artisan vendor:publish
```

Run migration to create settings table

```
php artisan migrate
```

You can register the facade in the `aliases` key of your `app/config/app.php` file.

```
'aliases' => array(
    'DbConfig' => 'Terbium\DbConfig\Facade'
)
```

Or replace default one

```
'aliases' => array(
    'Config' => 'Terbium\DbConfig\Facade'
)
```

\##Config

```
return [
    /**
     * 数据库表名
     */
    'table'      => 'settings',

    /**
     * 缓存配置
     * enable -- 是否缓存数据库内的配置
     * key -- 缓存键名
     * minutes -- 缓存时间
     */
    'cache'      => [
        'enable'  => true,
        'key'     => 'DbConfigCache',
        'minutes' => 1,
    ],

    /**
     * 是否开启多站点模式
     */
    'multi_site' => false,

    /**
     * 分库字段,供独立服务器配置
     * 自定义时需定义为大于1的整数
     */
    'database'   => 0,

    /**
     * 服务器id
     * 自定义时需定义为大于1的整数
     * 可自定义为env
     */
    'server_id'  => 0,

    /**
     * 配置白名单
     */
    'white_list' => [
        'app.env',
    ],

];
```

\##Specific commands

\###Store item into database table

```
Config::store($key, $value,$server = null, $database = null)
// this sets the key immediately
```

\###Remove item from the database

```
Config::forget($key,$server = null, $database = null)
```

\###Clear all current items from memory (they will be reloaded on next call)

```
Config::clear()
```

\###Truncate the table with settings

```
Config::clearDb($database = null)
```

\###Return query builder with list of settings from database

```
Config::listDb($wildcard = null)
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 56.3% 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 ~124 days

Recently: every ~35 days

Total

6

Last Release

3756d ago

Major Versions

1.0.0 → 2.0.02015-09-09

1.0.x-dev → v2.0.22016-01-27

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d93cb91a3ca8f40e862556063eb8ca360394ca32934a18583261ebdec4fc2fea?d=identicon)[apt-getyou](/maintainers/apt-getyou)

---

Top Contributors

[![yaapis](https://avatars.githubusercontent.com/u/390195?v=4)](https://github.com/yaapis "yaapis (18 commits)")[![terion-name](https://avatars.githubusercontent.com/u/1060205?v=4)](https://github.com/terion-name "terion-name (6 commits)")[![apt-getyou](https://avatars.githubusercontent.com/u/7362299?v=4)](https://github.com/apt-getyou "apt-getyou (4 commits)")[![ameenross](https://avatars.githubusercontent.com/u/859737?v=4)](https://github.com/ameenross "ameenross (2 commits)")[![nixbpe](https://avatars.githubusercontent.com/u/3845423?v=4)](https://github.com/nixbpe "nixbpe (2 commits)")

---

Tags

laravelconfiguration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/apt-getyou-db-config/health.svg)

```
[![Health](https://phpackages.com/badges/apt-getyou-db-config/health.svg)](https://phpackages.com/packages/apt-getyou-db-config)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminatech/array-factory

Allows DI aware object creation from array definition

2159.6k6](/packages/illuminatech-array-factory)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[torann/registry

Laravel registry manager for application configurations

222.0k](/packages/torann-registry)

PHPackages © 2026

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