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

ActiveFlightphp-plugin[Utility &amp; Helpers](/categories/utility)

enlivenapp/flight-settings
==========================

Database-backed key-value settings for FlightPHP, ported from CodeIgniter Settings

0.2.1(2mo ago)0149MITPHPPHP &gt;=8.1

Since Apr 18Pushed 2mo agoCompare

[ Source](https://github.com/enlivenapp/FlightPHP-Settings)[ Packagist](https://packagist.org/packages/enlivenapp/flight-settings)[ RSS](/packages/enlivenapp-flight-settings/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (7)Used By (9)

[![Stable? Not Quite Yet](https://camo.githubusercontent.com/8712c441bb32fd8db507e0008c5d13e30def50064f8fcbc689fbcf5191f7d2af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652533462d6e6f7425323071756974652532307965742d626c75653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/enlivenapp/flight-settings)[![License](https://camo.githubusercontent.com/37f460ce5822d05c3acfb22bade833616b9478b423c4b6701ae6da24b2b59f03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e6c6976656e6170702f666c696768742d73657474696e67733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/enlivenapp/flight-settings)[![PHP Version](https://camo.githubusercontent.com/47f1084ed6296db599ef5f195f6a316636786464fb5498bb043ba9a0ea68a334/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f656e6c6976656e6170702f666c696768742d73657474696e67733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/enlivenapp/flight-settings)[![Monthly Downloads](https://camo.githubusercontent.com/97b46a88f9c95b93a70129bb949ea774bacae20b16916d742683922836cc759f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f656e6c6976656e6170702f666c696768742d73657474696e67733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/enlivenapp/flight-settings)[![Total Downloads](https://camo.githubusercontent.com/e7a1a6e5be75ae01a3cf25e2dd8fa0f14bba7ff21c889b1f101d1c907eeee8cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e6c6976656e6170702f666c696768742d73657474696e67733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/enlivenapp/flight-settings)[![GitHub Issues](https://camo.githubusercontent.com/070f7d5347cb8e1d91c8569a9d578ec98a605419b46579a09e9ee52eccd2fb1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f656e6c6976656e6170702f466c696768745048502d53657474696e67733f7374796c653d666f722d7468652d6261646765)](https://github.com/enlivenapp/FlightPHP-Settings/issues)[![Contributors](https://camo.githubusercontent.com/ebeb9d87003b6cee742d13b6d8d0f1048cfd06ebf6771434323419639195dc14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f656e6c6976656e6170702f466c696768745048502d53657474696e67733f7374796c653d666f722d7468652d6261646765)](https://github.com/enlivenapp/FlightPHP-Settings/graphs/contributors)[![Latest Release](https://camo.githubusercontent.com/314961bf2d0e2404eaf2fca0544d08127de9badbfbaa9fea603600bfa4a3bfb0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f656e6c6976656e6170702f466c696768745048502d53657474696e67733f7374796c653d666f722d7468652d6261646765)](https://github.com/enlivenapp/FlightPHP-Settings/releases)[![Contributions Welcome](https://camo.githubusercontent.com/9db3f8b82ea88469efd296a9305fc00f40b4c9450bb6b539d42d339fa6963444/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d626c75653f7374796c653d666f722d7468652d6261646765)](https://github.com/enlivenapp/FlightPHP-Settings/pulls)

flight-settings
===============

[](#flight-settings)

**I noticed folks downloading some of these packages. I'm super grateful, Thank You! I would like to let folks know until this notice disappears I'm doing a lot of breaking changes without worrying about them. Once versions are up around 0.5.x things should settle down.**

A settings store for [FlightPHP](https://flightphp.com), built as a [Flight School](https://github.com/enlivenapp/FlightPHP-Flight-School) plugin. Values live in the database, get cached for the request, and keep their PHP types — write an int, read an int back.

What you get
------------

[](#what-you-get)

- Simple `get()` / `set()` / `forget()` API on `Flight::settings()`.
- Keys like `'Site.name'` or `'Auth.allowRegistration'`, grouped by the part preceeding the dot.
- Per-user, per-tenant, or any other scope — pass a `context` string.
- One query per scope per request. Everything after that comes from memory.

Requirements
------------

[](#requirements)

- PHP 8.1+
- `flightphp/core` ^3.0
- `enlivenapp/flight-school` ^0.2
- `enlivenapp/migrations`
- `flightphp/active-record`

Install
-------

[](#install)

```
composer require enlivenapp/flight-settings
```

Enable it in `app/config/config.php`:

```
'plugins' => [
    'enlivenapp/flight-settings' => [
        'enabled'  => true,
        'priority' => 20,
    ],
],
```

That's it. On the next page load, enlivenapp/migrations creates the `settings` table and seeds `CMS.siteName` and `CMS.siteByline` as baseline rows.

Flight School reads this package's `src/Config/Config.php` as a returned array and stores it on `$app` under `enlivenapp.flight-settings`. That file currently returns `'routePrepend' => null`, so the package does not register a public route prefix.

Quick start
-----------

[](#quick-start)

```
$settings = Flight::settings();

$name = $settings->get('CMS.siteName'); //null
$name = $settings->get('CMS.siteByline'); //null

$settings->set('CMS.siteName', 'My App');
$settings->set('CMS.siteByline', 'Do Great Things!');

$name = $settings->get('CMS.siteName'); // 'My App'
$name = $settings->get('CMS.siteByline'); // Do Great Things!
```

`get()` returns `null` when the key isn't in the database.

Keys
----

[](#keys)

Dot notation: the part before the dot is the group, the part after is the property. Both are required — a key without a dot throws `InvalidArgumentException`.

```
$settings->get('Auth.allowRegistration'); // group = Auth, property = allowRegistration
$settings->get('Mail.fromAddress');
```

Contexts
--------

[](#contexts)

A context lets the same setting hold different values for different things. You pick any string that identifies what the setting belongs to, and pass it as the `context` argument. Examples of what a context could be:

- A user ID → this setting belongs to user `42`
- A site code (if one app serves multiple sites) → this setting is for site `westcoast`
- A customer or organization ID → this setting belongs to `ACME Corp`
- A language code → this setting is for the Spanish version

Every row in the `settings` table has an optional `context` column. Writing with a context ties the row to that string; reading with the same string returns that row. Reading with no context returns the general (site-wide) row.

```
$settings->set('User.theme', 'dark', context: (string) $userId);
$settings->get('User.theme', context: (string) $userId);
$settings->forget('User.theme', context: (string) $userId);
```

`get()` with a context returns only that context's row, or `null` if there isn't one.

Types
-----

[](#types)

A database column doesn't remember PHP types. Save `true` and you usually read back `"1"`. Save `20` and you read back `"20"`. This plugin records the type next to the value so the cast is done for you on read — what you put in is what you get back.

```
$settings->set('Site.itemsPerPage', 20);
$settings->get('Site.itemsPerPage'); // 20 — integer, not "20"

$settings->set('Auth.allowRegistration', true);
$settings->get('Auth.allowRegistration'); // true — boolean, not "1"
```

Supported: `string`, `integer`, `double` (float), `boolean`, `array`, `object`, `NULL`. Arrays and objects are stored via PHP's `serialize()` and restored with `unserialize()` — so you can stash small structured values, just don't treat it like a document store.

API
---

[](#api)

All methods on `Flight::settings()`:

MethodSignatureWhat it does`get``get(string $key, ?string $context = null): mixed`Read. Returns `null` if not in the database.`set``set(string $key, mixed $value = null, ?string $context = null): void`Write. Cache updates immediately.`has``has(string $key, ?string $context = null): bool`Does a database row exist?`forget``forget(string $key, ?string $context = null): void`Delete one row.Schema
------

[](#schema)

The migration creates a `settings` table:

ColumnTypeNotes`id`intPrimary key`class`varchar(255)Part before the dot`key`varchar(255)Part after the dot`value`text, nullableSerialized value`type`varchar(31)PHP type, used for cast-back`context`varchar(255), nullableScope string; `NULL` = general`created_at`datetime, nullable`updated_at`datetime, nullableComposite index on `(class, key, context)`.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance84

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~3 days

Total

6

Last Release

80d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3036663?v=4)[Mike W](/maintainers/enlivenapp)[@enlivenapp](https://github.com/enlivenapp)

---

Top Contributors

[![enlivenapp](https://avatars.githubusercontent.com/u/3036663?v=4)](https://github.com/enlivenapp "enlivenapp (6 commits)")

### Embed Badge

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

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

###  Alternatives

[logaretm/transformers

Simple laravel eloquent models transformers.

2028.3k](/packages/logaretm-transformers)

PHPackages © 2026

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