PHPackages                             hiddencorporation/laravel-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. hiddencorporation/laravel-db-config

ActiveLibrary

hiddencorporation/laravel-db-config
===================================

:A package for laravel to handle configuration data set

1.0.12(4y ago)09MITPHP

Since Sep 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hiddenCorporation/laravel-db-config)[ Packagist](https://packagist.org/packages/hiddencorporation/laravel-db-config)[ Docs](https://github.com/hiddenCorporation/laravel-db-config)[ RSS](/packages/hiddencorporation-laravel-db-config/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

laravel-db-config
=================

[](#laravel-db-config)

> A package to manage configuration items and their properties in Laravel. php laravel configuration cache db

What it is
----------

[](#what-it-is)

Another library to handle configuration data in laravel, much more an exercice to handle gitHub/Packagist sync. This library.

In addition to allowing you to simply save variables in database, this package allows you to:

- Add a description to these variables.
- Standardize the caching of those variables (setting up indexes, updating the cache time, updating the cached config var).
- On-the-fly encryption / decryption of values.
- Automatically retrieving multiple configuration values.

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

[](#installation)

### Using GitHub

[](#using-github)

git clone `https://github.com/hiddenCorporation/laravel-db-config.git`

### Using Laravel Packager

[](#using-laravel-packager)

Using Laravel Packager `https://github.com/Jeroen-G/laravel-packager`. You can use artisan to integrate it in your laravel app.

`https://github.com/Jeroen-G/laravel-packager`

### Using Composer

[](#using-composer)

```
$ composer require hiddencorporation/laravel-db-config
```

Configuration
-------------

[](#configuration)

After having install the package, you need to :

**Publish configuration var for the package**

```
$ php artisan vendor:publish --tag=dbConfig.config
```

**Migrate database layout**

```
$ php artisan migrate
```

Configuration file &amp; env
----------------------------

[](#configuration-file--env)

\*\* (optional) change behaviour of package \*\*

To set in your .env :

- **DBCONFIG\_USECACHE**use cache or not.
- **DBCONFIG\_PREFIXCACHE** &amp; **DBCONFIG\_PREFIXCACHE\_INTERNAL**mostly use to avoid collision using a prefix to define perimeter.
- **auto cache management *experimental*** -

If cache enabled, you can add cache\_management option when setting a config. cache\_management can be fix or auto. (fix is the default value).

Auto mode is still in evaluation.

- fix : use only cache\_duration
- auto :

If cache\_duration is filled, system will register in cache your config with this time. If not this field will take value of cache\_duration\_default.

- **DBCONFIG\_CACHE\_AUTO\_GET**Activate get process to improve cache\_duration.
- **DBCONFIG\_CACHE\_AUTO\_MODIFY**Activate modify process to improve cache\_duration.
- **DBCONFIG\_CACHE\_DURATION\_MIN**In seconds, the minimum amount of time for auto Cached var.
- **DBCONFIG\_CACHE\_DURATION\_MAX**In seconds, the maximum amount of time for auto Cached var.
- **DBCONFIG\_CACHE\_DURATION\_DEFAULT**In seconds, the amount of time by default for auto Cached var.
- **DBCONFIG\_CACHE\_SSM\_FLOOR**Between 1 and 0 think of it as a ratio : I want 20% of the modification for the same var happening when not cached, my ratio will be 0.8.
- **DBCONFIG\_CACHE\_TSM\_FLOOR**Number of Modification used to recalculate cache\_duration think of it like a dataset of ssm.
- **DBCONFIG\_CACHE\_SSG\_FLOOR**Between 1 and 0 think of it as a ratio : I want 20% of the get for the same var happening when not cached, my ratio will be 0.8.
- **DBCONFIG\_CACHE\_TSG\_FLOOR**Number of get request used to recalculate cache\_duration think of it like a dataset of ssg.

cache\_ssg\_floor and cache\_tsg\_floor are used to decrease cache\_duration of a var.

- **DBCONFIG\_CACHE\_CALCULUS\_PRECISION**Between 0 and 1. To avoid an eternal fight between modification and get we can fix an additionnal ratio : For example for a ccp of 0.02 :

with the ssm of 0.8 the score calculus of a modification has to be between 0.078 and 0.082 to be considered good same for the get Operation

Methods
-------

[](#methods)

- **dbConfig::set($name,$value,$additionalAttribute=array())**

1. **$name** the name of the var will be slugify to forge a *technical\_name*.
2. **$value** can be all kind of var
3. **$additionalAttribute**\_ **description** (string) \_ **cache\_duration** (int), Seconds use for fix cache or to set a duration to begin when in auto. \_ **cache\_management** fix or auto by default fixed. \_ **crypted** (bool)

return An array with operation status and the element if created, if not list of errors.

- **dbConfig::get($entity=false,$defaultReturnValue = Null,$full=false)**

1. **$entity** the config id, the technical Name of a config element or a mixed array of both.
2. **$defaultReturnValue** (defaut = Null) The default return value you want.
3. **$full** if true will return all info about the configuration var

It can return null if data not found, an array of var if entity is an array,a single value or the value with all info if full = true.

- **dbConfig::update($entity=false,$value=Null,$additionalAttribute=array())**

1. **$entity** $entity\_id or technical\_name
2. **$value** (default Null), the new value or nothing if you just want to manage additional attributes.
3. **$additionalAttribute** *see dbConfig::set*

Return An array with the detail of the operation and the configuration element if found.

- **dbConfig::unset($entity)**

1. **$entity** entity id or technical\_name
2. **$infoSup** (default false) To get more intel about where the config has been found.

Return *cache*, *db* or *true/false* depends if $infoSup is true

Return Null, true or false

- **dbConfig::configExist($entity,$infoSup=false)**

Commands
--------

[](#commands)

```
$ php artisan dbConfig:clear --operation=[db,cache,all]
```

*The clear cache specifically target elements used by dbConfig leaving other cached things intacts*

```
$ php artisan dbConfig:test --which=[info, testCache, testCrypt, testGeneral]
```

*The test has been done for basic use, auto cache management has not been tested at the moment.*

Unit test
---------

[](#unit-test)

```
$ vendor/bin/phpunit packages/Hephaistos/dbConfig
```

*The testUnits replicate test of dbConfig:test*

Roadmap
-------

[](#roadmap)

1. test auto mode
2. create unit test for benchmarking the package for the auto Cache Management

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~119 days

Total

3

Last Release

1811d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16838599?v=4)[Aurélien Lanos](/maintainers/hiddenCorporation)[@hiddenCorporation](https://github.com/hiddenCorporation)

---

Top Contributors

[![hiddenCorporation](https://avatars.githubusercontent.com/u/16838599?v=4)](https://github.com/hiddenCorporation "hiddenCorporation (1 commits)")

---

Tags

phplaravelconfigurationpackagedb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hiddencorporation-laravel-db-config/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7012.8k](/packages/tehwave-laravel-achievements)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

1484.6k3](/packages/calebdw-larastan)[martian/spammailchecker

A laravel package that protect users from entering non-existing/spam email addresses.

422.0k](/packages/martian-spammailchecker)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

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