PHPackages                             larapacks/setting - 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. [Security](/categories/security)
4. /
5. larapacks/setting

ActiveProject[Security](/categories/security)

larapacks/setting
=================

Persistent Laravel configuration settings.

v3.0.2(3y ago)57.1k↓50%2MITPHPPHP &gt;=7.2CI failing

Since Jul 15Pushed 3y ago2 watchersCompare

[ Source](https://github.com/larapacks/setting)[ Packagist](https://packagist.org/packages/larapacks/setting)[ RSS](/packages/larapacks-setting/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

Setting
=======

[](#setting)

[![Build Status](https://camo.githubusercontent.com/e00793454dc64565d62299eacc4f6220befd0f2847d3ddd13b79d81b78690ae8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6172617061636b732f73657474696e672f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/larapacks/setting/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/45bec0c30233ad001c633457e0164e8e677a627559d0aa255e7d7e948c9f1d20/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c6172617061636b732f73657474696e672f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/larapacks/setting/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/63792b4848f7474cc1c7a6f7a9d324c2106cd30ffc0d47dd1e1ac4718d47028e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172617061636b732f73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larapacks/setting)[![Latest Stable Version](https://camo.githubusercontent.com/56d9c6f8afd00bbca6e326048f195b03e024e53ebb70e3a91447bc4b9c9d8a84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172617061636b732f73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larapacks/setting)[![License](https://camo.githubusercontent.com/19c73b317b4321318b0da7d480750f20830d1b4bf83d7a3f2b686e6de6e425c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6172617061636b732f73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larapacks/setting)

Description
-----------

[](#description)

Setting is an easy, encrypted &amp; cached, database key =&gt; value store for your laravel application.

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

[](#requirements)

- PHP &gt;= 7.2
- Laravel &gt;= 6.0

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

[](#installation)

Run the following command:

```
composer require larapacks/setting
```

> **Note**: The service provider and `Setting` facade are registered automatically.

Once that's complete, publish the migration and configuration file using:

```
php artisan vendor:publish --tag="setting"
```

Then run `php artisan migrate`.

Usage
-----

[](#usage)

> **Note**: All usage below can be accessed via the helper method `setting()`.

Setting a value:

```
Setting::set('key', 'value');
```

Setting multiple values:

```
Setting::set([
    'key.1' => 'value',
    'key.2' => 'value',
    'key.3' => 'value',
]);
```

Retrieving a value:

```
$value = Setting::get('key.1');

dd($value); // Returns 'value'
```

Retrieving a value or return default value if it doesn't exist:

```
$value = Setting::get('non-existent-key', 'default');

dd($value); // Returns 'default'
```

Retrieving the Setting model for a particular key:

```
$model = Setting::find('key.1');

dd($model); // Reurns instance of Model (your configured model).
```

Retrieving all keys with values:

```
Setting::set([
    'key.1' => 'value',
    'key.2' => 'value',
    'key.3' => 'value',
]);

$settings = Setting::all();

dd($settings);

// Returns:
// array [
//  'key.1' => 'value',
//  'key.2' => 'value',
//  'key.3' => 'value',
// ]
```

Retrieving the your configured Setting model:

```
$model = Setting::model();

$setting = new $model();

$setting->key = 'key';
$setting->value = 'value';

$setting->save();
```

Determining if a setting exists:

```
if (Setting::has('key')) {
    // The setting exists.
}
```

Flipping a boolean setting:

```
Setting::set('notifications', true);

// Disable notifications.
Setting::flip('notifications');

dd(Setting::get('notifications')); // Returns false.

// Enable notifications.
Setting::flip('notifications');

dd(Setting::get('notifications')); // Returns true.

// Default flip setting:
Setting::flip('new-key');

dd(Setting::get('new-key')); // Retuns true.
```

Enabling a boolean setting:

```
Setting::set('notifications', false);

Setting::enable('notifications');

dd(Setting::get('notifications')); // Returns true.
```

Disabling a boolean setting:

```
Setting::set('notifications', true);

Setting::disable('notifications');

dd(Setting::get('notifications')); // Returns false.
```

Using your own model
--------------------

[](#using-your-own-model)

To use your own model, change the `model` configuration option in your `config/settings.php` file.

When you create your own model, be sure to include the trait: `Larapacks\Setting\Traits\SettingTrait`:

```
namespace App;

use Larapacks\Setting\Traits\SettingTrait;

class Setting extends Model
{
    use SettingTrait;
}
```

Encryption
----------

[](#encryption)

Encryption can be enabled or disabled in the published configuration file. By default, it is enabled.

Encryption is performed by laravel's included helper methods `encrypt()` and `decrypt()`.

You can enable or disable encryption at any time, however upon disabling encryption you will receive the raw encrypted string for settings that have previously been encrypted.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~161 days

Recently: every ~228 days

Total

16

Last Release

1168d ago

Major Versions

v1.0.8 → v2.0.02019-11-15

v2.1.1 → v3.0.02020-09-09

PHP version history (2 changes)v1.0.0PHP &gt;=5.5.9

v2.0.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![stevebauman](https://avatars.githubusercontent.com/u/6421846?v=4)](https://github.com/stevebauman "stevebauman (95 commits)")[![pacoorozco](https://avatars.githubusercontent.com/u/2443200?v=4)](https://github.com/pacoorozco "pacoorozco (3 commits)")[![mikerockett](https://avatars.githubusercontent.com/u/4586280?v=4)](https://github.com/mikerockett "mikerockett (2 commits)")

---

Tags

encryptionlaravelsettingsconfigurationSettingssetting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/larapacks-setting/health.svg)

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

###  Alternatives

[selective/config

Config component, strictly typed

19185.8k3](/packages/selective-config)[psecio/secure_dotenv

An encrypted environment configuration handler

11537.7k2](/packages/psecio-secure-dotenv)[hackeresq/laravel-settings

Super simple key/value settings for Laravel 8+

312.1k](/packages/hackeresq-laravel-settings)[rezzza/vaultage

Keep secrets secret

214.4k](/packages/rezzza-vaultage)[cornford/setter

An easy way to integrate Database Settings with Laravel.

131.0k](/packages/cornford-setter)

PHPackages © 2026

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