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

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

tatter/settings
===============

Lightweight settings management for CodeIgniter 4

v2.1.0(4y ago)2310.0k5[2 PRs](https://github.com/tattersoftware/codeigniter4-settings/pulls)3MITPHPPHP ^7.3 || ^8.0

Since Apr 8Pushed 2y ago3 watchersCompare

[ Source](https://github.com/tattersoftware/codeigniter4-settings)[ Packagist](https://packagist.org/packages/tatter/settings)[ Docs](https://github.com/tattersoftware/codeigniter4-settings)[ Fund](https://paypal.me/tatter)[ GitHub Sponsors](https://github.com/tattersoftware)[ RSS](/packages/tatter-settings/feed)WikiDiscussions develop Synced 5d ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (3)

Tatter\\Settings
================

[](#tattersettings)

Lightweight settings management for CodeIgniter 4

[![](https://github.com/tattersoftware/codeigniter4-settings/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-settings/actions/workflows/test.yml)[![](https://github.com/tattersoftware/codeigniter4-settings/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-settings/actions/workflows/analyze.yml)[![](https://github.com/tattersoftware/codeigniter4-settings/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-settings/actions/workflows/inspect.yml)[![Coverage Status](https://camo.githubusercontent.com/8e7403e95924bf0a377abf4cfb64ded530042c9aa6432aa96d5e3d9bf9d7ab2f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f746174746572736f6674776172652f636f646569676e69746572342d73657474696e67732f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/tattersoftware/codeigniter4-settings?branch=develop)

WARNING
-------

[](#warning)

Since this library's last major version the CodeIgniter team has published its own [Settings Library](https://github.com/codeigniter4/settings). That library and this offer some non-overlapping features but they do represent a conflict in name and implementation. The future of this library is not yet determined, but some options are:

- Deprecate this library and move any missing features to the CodeIgniter version
- Rework this library as an extension of the official package
- Maintain the current functionality with a name change to avoid conflict

To follow or contribute to the planning for this library please visit the [Upcoming Changes Discussion](https://github.com/tattersoftware/codeigniter4-settings/discussions/31).

Quick Start
-----------

[](#quick-start)

1. Install with Composer: `> composer require tatter/settings`
2. Update the database: `> php spark migrate -all`
3. Use `spark` to create templates: `> php spark settings:add timezone user America/New_York`
4. Use the service to access user settings:

```
service('settings')->timezone = $_POST['timezone_preference'];
...
$userTimezone = service('settings')->timezone;

```

Features
--------

[](#features)

Provides ready-to-use settings management for CodeIgniter 4

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

[](#installation)

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

- `> composer require tatter/settings`

Or, install manually by downloading the source files and adding the directory to `app/Config/Autoload.php`.

Once the files are downloaded and included in the autoload, run any library migrations to ensure the database is setup correctly:

- `> php spark migrate -all`

Usage
-----

[](#usage)

Once the library is included all the resources are ready to go and you are ready to start adding settings. You may import setting templates directly into the `settings` table or add them manually with the CLI command `php spark settings:add`.

**Settings** also comes with a database seeder for some recommended default templates. Run the seeder from the command line:

```
php spark db:seed "Tatter\Settings\Database\Seeds\SettingsSeeder"

```

This will add appropriately-scoped templates and default values for the following settings:

NameDescriptionData TypeDefault ValueProtectedsiteVersionCurrent version of this projectstring1.0.0YesbrandNameBrand name for this projectstringBrandYesbrandLogoBrand logo for this projectstring/assets/images/logo.pngYesorgNameYour organization namestringOrganizationYesorgLogoYour organization logostring/assets/images/logo.pngYesorgUrlYour organization URLuriYesorgAddressYour organization addressstring4141 Postmark Dr Anchorage, AKYesorgPhoneYour organization phonestring(951) 262-3062YescurrencyUnitCurrency format for number helperstringUSDYescurrencyScaleConversion rate to the fractional monetary unitint100YesdatabaseTimezoneTimezone for the database server(sstringUTCYesserverTimezoneTimezone for the web server(s)stringUTCYestimezoneTimezone for the userstringAmerica/New\_YorkNothemeSite display themeint1NoperPageNumber of items to show per pageint10No*Warning: This list is subject to change between major versions.*

Note that the seeder will not overwrite existing values so it is safe to re-run at any time. See also [src/Database/Seeds/SettingsSeeder.php](src/Database/Seeds/SettingsSeeder.php).

### Setting Scope

[](#setting-scope)

`Settings` come in three modes: global, user, and dynamic.

- Global settings are the same for every user and provide project owners to set application-wide values; set `protected` to `1`
- User settings start with a template value but each user may make their own value that persists across sessions; set `protected` to `0`
- Dynamic settings have no template but can be created and returned on-the-fly; they only persists for the current session.

Examples:

NameScopeContentNotesProtected?latestReleaseGlobal0.7.6Git-style tag of latest code release1timezoneUserAmerica/New\_YorkLocal timezone to use across the application0perPageUser10Default number of items to show per page0jobsSearchDynamicbackend phpUser's most recent search term for jobsn/a- When you release a new version of your software:

    model('SettingModel')-&gt;where('name', 'latestRelease')-&gt;update(\['content' =&gt; '1.2.3'); echo view('home', \['latestRelease' =&gt; service('settings')-&gt;latestRelease\]);
- When a user searches a list of jobs:

    $settings-&gt;jobsSearch = $\_POST\['searchTerm'\]; $data\['jobs'\] = $jobModel-&gt;paginate($settings-&gt;perPage);

### Magic Config

[](#magic-config)

`Settings` comes with a magic configuration file that allows direct access to template values. This is a convenient way to access the library in a traditional framework fashion:

```
$logo = config('Settings')->projectLogo;

```

Note that unlike the Service or Library values from the magic config are directly from the template default and are not affected by user overrides:

```
service('settings')->set('perPage', 20);

echo service('settings')->perPage; // 20
echo config('Settings')->perPage; // 10

```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~82 days

Recently: every ~59 days

Total

11

Last Release

1818d ago

Major Versions

v1.2.1 → v2.0.02021-05-26

PHP version history (3 changes)v1.0.0PHP ^7.0

v1.1.0PHP &gt;=7.2

v1.2.0PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ebe908b4fe73807ecdd9f88733342199c9991b7de800329f5b2b787c8210d62?d=identicon)[MGatner](/maintainers/MGatner)

---

Top Contributors

[![MGatner](https://avatars.githubusercontent.com/u/17572847?v=4)](https://github.com/MGatner "MGatner (68 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

Settingscodeigniterpreferencescodeigniter4

### Embed Badge

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

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

###  Alternatives

[codeigniter4/settings

Settings library for CodeIgniter 4

95589.6k34](/packages/codeigniter4-settings)[codeigniter4/tasks

Task Scheduler for CodeIgniter 4

124177.3k1](/packages/codeigniter4-tasks)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

69201.9k120](/packages/codeigniter4-devkit)[jbtronics/settings-bundle

A symfony bundle to easily create typesafe, user-configurable settings for symfony applications

9558.8k3](/packages/jbtronics-settings-bundle)[tatter/alerts

Lightweight user alerts for CodeIgniter 4

4080.9k6](/packages/tatter-alerts)[tatter/patches

Automated project updates for CodeIgniter 4

3692.9k3](/packages/tatter-patches)

PHPackages © 2026

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