PHPackages                             nimblephp/settings - 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. nimblephp/settings

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

nimblephp/settings
==================

Runtime key-value settings for NimblePHP, stored in the database with typed values and per-request caching

00PHP

Since Jun 30Pushed todayCompare

[ Source](https://github.com/NimbleMVC/Settings)[ Packagist](https://packagist.org/packages/nimblephp/settings)[ RSS](/packages/nimblephp-settings/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

nimblephp/settings
==================

[](#nimblephpsettings)

Runtime key-value settings for NimblePHP. Stores typed values in the database (table `module_setting`) and caches them per request.

Contents
--------

[](#contents)

- `Module` — module registration and migrations (`onUpdate`)
- `ModuleSettingModel` — settings manager (get, set, has, forget, all)
- `SettingType` — value type enum (`string`, `integer`, `float`, `boolean`, `json`) with encode/decode
- `SettingsException` — module exception
- `src/Migrations/` — migration creating the `module_setting` table

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

[](#installation)

```
composer require nimblephp/settings
```

Migration
---------

[](#migration)

Migrations run automatically on application update (`Module::onUpdate()`, group `module_setting`). They can also be run manually:

```
php vendor/bin/nimble migration:run --dir=vendor/nimblephp/settings/src/Migrations
```

Usage
-----

[](#usage)

```
use NimblePHP\Settings\ModuleSettingModel;

$settings = $this->loadModel(ModuleSettingModel::class);

// store (type is derived from the value)
$settings->set('site.name', 'My App');     // string
$settings->set('mail.enabled', true);       // boolean
$settings->set('uploads.maxMb', 25);        // integer
$settings->set('feature.flags', ['beta' => true]); // json

// read (typed value back, with default)
$name = $settings->get('site.name', 'Default');
$enabled = $settings->get('mail.enabled', false);

// check / remove / list
$settings->has('site.name');
$settings->forget('site.name');
$all = $settings->all(); // ['key' => value, ...]
```

Values are loaded once per request and kept in an in-memory cache. `set()` and `forget()` keep the cache in sync; call `flushCache()` to force a reload.

Service / facade (no `loadModel` needed)
----------------------------------------

[](#service--facade-no-loadmodel-needed)

`Module::register()` registers a `SettingsService` in the container under the id `settings`, so settings are reachable application-wide:

```
use NimblePHP\Framework\Kernel;

$settings = Kernel::$serviceContainer->get('settings'); // SettingsService
$settings->set('site.name', 'My App');
```

Or via the static facade (self-registers the service on demand):

```
use NimblePHP\Settings\Settings;

Settings::set('mail.enabled', true);
$enabled = Settings::get('mail.enabled', false);
```

The service, the facade and the model all share the same per-request cache.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b71301619d71d2798d3a84f23de616ac1f1c185ab72e4f03e925cff169b03a0d?d=identicon)[krzysztofzylka](/maintainers/krzysztofzylka)

---

Top Contributors

[![krzysztofzylka](https://avatars.githubusercontent.com/u/41385342?v=4)](https://github.com/krzysztofzylka "krzysztofzylka (2 commits)")

### Embed Badge

![Health badge](/badges/nimblephp-settings/health.svg)

```
[![Health](https://phpackages.com/badges/nimblephp-settings/health.svg)](https://phpackages.com/packages/nimblephp-settings)
```

###  Alternatives

[crisu83/shortid

15127.2k6](/packages/crisu83-shortid)[components/modernizr

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user's browser.

10255.5k8](/packages/components-modernizr)

PHPackages © 2026

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