PHPackages                             solomon-ochepa/laravel-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. [Database &amp; ORM](/categories/database)
4. /
5. solomon-ochepa/laravel-settings

ActiveLibrary[Database &amp; ORM](/categories/database)

solomon-ochepa/laravel-settings
===============================

Store settings as key-value pairs in the database.

v25.11.23(5mo ago)37.6k↓23.7%MITPHPPHP &gt;=7.3

Since Jun 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/solomon-ochepa/laravel-settings)[ Packagist](https://packagist.org/packages/solomon-ochepa/laravel-settings)[ Docs](https://github.com/solomon-ochepa/laravel-settings)[ RSS](/packages/solomon-ochepa-laravel-settings/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (15)Used By (0)

laravel-settings
================

[](#laravel-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9f0b83780be670a2b553ccee256da6c99373c1b671d3c26cb2ca128754f62c4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6c6f6d6f6e2d6f63686570612f6c61726176656c2d73657474696e67732e737667)](https://packagist.org/packages/solomon-ochepa/laravel-settings)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/319e2c5f05be98b87899c2618b7fd1a71759f5f41bbb1cac5563d43fd79cd508/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6c6f6d6f6e2d6f63686570612f6c61726176656c2d73657474696e67732e737667)](https://packagist.org/packages/solomon-ochepa/laravel-settings)

Store settings as key-value pairs in the database.

> All the settings saved in the database are cached to improve performance by reducing SQL queries to zero.

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

[](#installation)

You can install the package via composer:

```
composer require solomon-ochepa/laravel-settings
```

### Laravel 5.4

[](#laravel-54)

If you are installing on Laravel 5.4 or lower, you will need to manually register the Service Provider by adding it to the `providers` array and the Facade to the `aliases` array in `config/app.php`.

```
'providers' => [
    //...
    SolomonOchepa\Settings\SettingsServiceProvider::class
]

'aliases' => [
    //...
    "Settings" => SolomonOchepa\Settings\Facades\Settings::class
]
```

In Laravel 5.5 or above, the service provider automatically gets registered, and the `Settings` facade will be available immediately.

Get started with `Settings::all()`.

Migration
---------

[](#migration)

Optionally, you can publish the migration file by running:

```
php artisan vendor:publish --provider="SolomonOchepa\Settings\SettingsServiceProvider" --tag="migrations"

```

Now, run `php artisan migrate` to migrate the settings table.

Getting Started
---------------

[](#getting-started)

You can utilize the Laravel settings package using either the helper function `settings()` or the facade `Settings::all()`.

Methods
-------

[](#methods)

#### `all()`

[](#all)

\-- Pass `true` to ignore cached settings

```
settings();
// or
settings()->all($fresh = false);
// or
Settings::all($fresh = false);
```

#### `get()`

[](#get)

Get a specific setting

```
settings($key, $default = null);
// or
settings()->get($key, $default = null);
// or
Settings::get($key, $default = null);
```

#### `my()`

[](#my)

Get the `auth()` user settings.

```
settings()->my($key, $default = null);
// or
Settings::my($key, $default = null);
```

#### `set()`

[](#set)

Set a specific setting

```
settings([$key => $value]);
// or
settings()->set($key, $value);
// or
Settings::set($key, $value);
```

// Set a multiple settings

```
settings([$key => $value, $key2 => $value2]);
// or
settings()->set([
   $key => $value,
   $key2 => $value2,
]);
// or
Settings::set([
   $key => $value,
   $key2 => $value2,
]);
```

#### `has()`

[](#has)

Check if a setting key exists

```
settings()->has($key);
// or
Settings::has($key);
```

#### `remove()`

[](#remove)

Remove a setting

```
settings()->remove($key);
// or
Settings::remove($key);
```

Groups
------

[](#groups)

You can organize your settings into groups.

> If you are upgrading from a previous version, don't forget to run the migration.

Initiate grouping by chaining the `group()` method:

```
// Save setting
settings([$key => $value])->group($name);

// Get setting
settings($key)->group($name);
```

Settable `for()`
----------------

[](#settable-for)

Get/set settings for a specific entity

```
Settings::for($settable)->set($key, $value)

// helper function
settings()->for($settable)->set($key, $value)

// Example:
settings()->for(auth()->user())->set($key, $value);
```

Settable `user()`
-----------------

[](#settable-user)

Bind settings to the auth user.

```
settings()->user()->all();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

### Testing

[](#testing)

The package contains some integration/smoke tests, set up with Orchestra. The tests can be run via phpunit.

```
$ composer test
```

### Contributing

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

### Credits

[](#credits)

- ...

About "Oki Technologies Ltd"
----------------------------

[](#about-oki-technologies-ltd)

Oki Technologies,  is a dynamic IT firm dedicated to delivering cutting-edge solutions in software development and related services. With a passion for innovation and a commitment to excellence, Oki Technologies leverages the latest technologies and industry best practices to craft tailored solutions that meet the unique needs of each client.

From web and mobile application development to custom software solutions, Oki Technologies offers a comprehensive suite of services designed to empower businesses and organizations across various industries. With a team of skilled professionals, Oki Technologies combines technical expertise with creative insights to deliver high-quality, scalable, and user-friendly software solutions.

At Oki Technologies, we prioritize customer satisfaction and strive to build long-term partnerships with our clients. Our collaborative approach ensures that we understand our clients' goals and objectives, allowing us to deliver solutions that drive tangible results and add value to their businesses.

Whether you're a startup looking to launch a digital product or an established enterprise seeking to optimize your existing software infrastructure, Oki Technologies is your trusted partner for all your software development needs. Let us help you turn your ideas into reality and propel your business to new heights in the digital age.

### License

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Recently: every ~53 days

Total

13

Last Release

176d ago

Major Versions

v1.2.2 → v12.0.02025-03-12

v12.7.22 → v25.11.232025-11-23

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0|^8.1|^8.2

v12.0.0PHP ^8.1

v12.7.3PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b84d170842bb5693770a44f2a31bb4c4f3b3224b4cb65696a3abb10af9e0b4d?d=identicon)[solomon-ochepa](/maintainers/solomon-ochepa)

---

Top Contributors

[![solomon-ochepa](https://avatars.githubusercontent.com/u/110875083?v=4)](https://github.com/solomon-ochepa "solomon-ochepa (24 commits)")

---

Tags

laravelSettingseloquentlaravel-settingssolomon-ochepalaravel-user-settingsokilaravel-settablekey-value-settings

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/solomon-ochepa-laravel-settings/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[bavix/laravel-clickhouse

Eloquent model for ClickHouse

72214.1k2](/packages/bavix-laravel-clickhouse)[rennokki/eloquent-settings

Eloquent Settings allows you to bind key-value pairs to any Laravel Eloquent model. It supports even casting for boolean, float or integer types.

804.2k](/packages/rennokki-eloquent-settings)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)[waad/laravel-model-metadata

A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.

823.1k](/packages/waad-laravel-model-metadata)[mozex/laravel-scout-bulk-actions

A Laravel Scout extension for bulk importing and flushing of all models.

1033.4k](/packages/mozex-laravel-scout-bulk-actions)

PHPackages © 2026

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