PHPackages                             jesprna/jaysfi-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jesprna/jaysfi-setting

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

jesprna/jaysfi-setting
======================

Persistent settings package for Laravel

v1.0.0(3mo ago)0418↓50.6%MITPHPPHP &gt;=5.5.9

Since Jan 10Pushed 3mo agoCompare

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

READMEChangelogDependencies (4)Versions (2)Used By (0)

Persistent settings package for Laravel
=======================================

[](#persistent-settings-package-for-laravel)

[![Downloads](https://camo.githubusercontent.com/108db92c4e480c470fa588b4c2d51417dccce9eeb4fa470d13fa98b71680f8ed/68747470733a2f2f706f7365722e707567782e6f72672f6a657370726e612f6a61797366692d73657474696e672f642f746f74616c2e737667)](https://github.com/jesprna/jaysfi-setting)[![StyleCI](https://camo.githubusercontent.com/06cde0dea1746dab188631de2876fad9c8aee78c170e7795b0f7ff4216ec6505/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130313233313831372f736869656c643f7374796c653d666c6174266272616e63683d6d6173746572)](https://styleci.io/repos/101231817)[![License](https://camo.githubusercontent.com/44c4a020652da2eec7f644f624c58d6c557049cb1968932f3ad29e22838b746b/68747470733a2f2f706f7365722e707567782e6f72672f6a657370726e612f6a61797366692d73657474696e672f6c6963656e73652e737667)](LICENSE.md)

This package allows you to save settings in a more persistent way. You can use the database and/or json file to save your settings. You can also override the Laravel config.

- Driver support
- Helper function
- Blade directive
- Override config values
- Encryption
- Custom file, table and columns
- Auto save
- Extra columns
- Cache support

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

[](#getting-started)

### 1. Install

[](#1-install)

Run the following command:

```
composer require jesprna/jaysfi-setting
```

### 2. Register (for Laravel &lt; 5.5)

[](#2-register-for-laravel--55)

Register the service provider in `config/app.php`

```
Jesprna\Setting\Provider::class,
```

Add alias if you want to use the facade.

```
'Setting' => Jesprna\Setting\Facade::class,
```

### 3. Publish

[](#3-publish)

Publish config file.

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

### 4. Database

[](#4-database)

Create table for database driver

```
php artisan migrate
```

### 5. Configure

[](#5-configure)

You can change the options of your app from `config/setting.php` file

Usage
-----

[](#usage)

You can either use the helper method like `setting('foo')` or the facade `Setting::get('foo')`

### Facade

[](#facade)

```
Setting::get('foo', 'default');
Setting::get('nested.element');
Setting::set('foo', 'bar');
Setting::forget('foo');
$settings = Setting::all();
```

### Helper

[](#helper)

```
setting('foo', 'default');
setting('nested.element');
setting(['foo' => 'bar']);
setting()->forget('foo');
$settings = setting()->all();
```

You can call the `save()` method to save the changes.

### Auto Save

[](#auto-save)

If you enable the `auto_save` option in the config file, settings will be saved automatically every time the application shuts down if anything has been changed.

### Blade Directive

[](#blade-directive)

You can get the settings directly in your blade templates using the helper method or the blade directive like `@setting('foo')`

### Override Config Values

[](#override-config-values)

You can easily override default config values by adding them to the `override` option in `config/setting.php`, thereby eliminating the need to modify the default config files and also allowing you to change said values during production. Ex:

```
'override' => [
    "app.name" => "app_name",
    "app.env" => "app_env",
    "mail.driver" => "app_mail_driver",
    "mail.host" => "app_mail_host",
],
```

The values on the left corresponds to the respective config value (Ex: config('app.name')) and the value on the right is the name of the `key` in your settings table/json file.

### Encryption

[](#encryption)

If you like to encrypt the values for a given key, you can pass the key to the `encrypted_keys` option in `config/setting.php` and the rest is automatically handled by using Laravel's built-in encryption facilities. Ex:

```
'encrypted_keys' => [
    "payment.key",
],
```

### JSON Storage

[](#json-storage)

You can modify the path used on run-time using `setting()->setPath($path)`.

### Database Storage

[](#database-storage)

If you want to use the database as settings storage then you should run the `php artisan migrate`. You can modify the table fields from the `create_settings_table` file in the migrations directory.

#### Extra Columns

[](#extra-columns)

If you want to store settings for multiple users/clients in the same database you can do so by specifying extra columns:

```
setting()->setExtraColumns(['user_id' => Auth::user()->id]);
```

where `user_id = x` will now be added to the database query when settings are retrieved, and when new settings are saved, the `user_id` will be populated.

If you need more fine-tuned control over which data gets queried, you can use the `setConstraint` method which takes a closure with two arguments:

- `$query` is the query builder instance
- `$insert` is a boolean telling you whether the query is an insert or not. If it is an insert, you usually don't need to do anything to `$query`.

```
setting()->setConstraint(function($query, $insert) {
	if ($insert) return;
	$query->where(/* ... */);
});
```

### Custom Drivers

[](#custom-drivers)

This package uses the Laravel `Manager` class under the hood, so it's easy to add your own storage driver. All you need to do is extend the abstract `Driver` class, implement the abstract methods and call `setting()->extend`.

```
class MyDriver extends Jesprna\Setting\Contracts\Driver
{
	// ...
}

app('setting.manager')->extend('mydriver', function($app) {
	return $app->make('MyDriver');
});
```

Changelog
---------

[](#changelog)

Please see [Releases](../../releases) for more information what has changed recently.

Contributing
------------

[](#contributing)

Pull requests are more than welcome. You must follow the PSR coding standards.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Jays](https://github.com/jesprna)
- [Denis Duliçi](https://github.com/denisdulici)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance83

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.9% 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

Unknown

Total

1

Last Release

119d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/999042c0244396cbd9fbee3654cbc6ab436604538a3b3daac92505b4bfbec06f?d=identicon)[jesprna](/maintainers/jesprna)

---

Top Contributors

[![denisdulici](https://avatars.githubusercontent.com/u/5254835?v=4)](https://github.com/denisdulici "denisdulici (64 commits)")[![pashamesh](https://avatars.githubusercontent.com/u/1695806?v=4)](https://github.com/pashamesh "pashamesh (4 commits)")[![uyab](https://avatars.githubusercontent.com/u/149716?v=4)](https://github.com/uyab "uyab (3 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (3 commits)")[![jesprna](https://avatars.githubusercontent.com/u/48647209?v=4)](https://github.com/jesprna "jesprna (3 commits)")[![rick20](https://avatars.githubusercontent.com/u/1517180?v=4)](https://github.com/rick20 "rick20 (2 commits)")[![IsraelOrtuno](https://avatars.githubusercontent.com/u/1769417?v=4)](https://github.com/IsraelOrtuno "IsraelOrtuno (1 commits)")[![semiherdogan](https://avatars.githubusercontent.com/u/5646041?v=4)](https://github.com/semiherdogan "semiherdogan (1 commits)")[![yooslim](https://avatars.githubusercontent.com/u/4048632?v=4)](https://github.com/yooslim "yooslim (1 commits)")[![braceyourself](https://avatars.githubusercontent.com/u/13386086?v=4)](https://github.com/braceyourself "braceyourself (1 commits)")[![ysfkaya](https://avatars.githubusercontent.com/u/16710972?v=4)](https://github.com/ysfkaya "ysfkaya (1 commits)")[![cuneytsenturk](https://avatars.githubusercontent.com/u/10936547?v=4)](https://github.com/cuneytsenturk "cuneytsenturk (1 commits)")[![delmicio](https://avatars.githubusercontent.com/u/2908209?v=4)](https://github.com/delmicio "delmicio (1 commits)")[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")[![elnurxf](https://avatars.githubusercontent.com/u/2572412?v=4)](https://github.com/elnurxf "elnurxf (1 commits)")[![erayaydin](https://avatars.githubusercontent.com/u/5854916?v=4)](https://github.com/erayaydin "erayaydin (1 commits)")

---

Tags

laravelSettingsconfigpersistent

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[akaunting/laravel-setting

Persistent settings package for Laravel

495805.1k7](/packages/akaunting-laravel-setting)[efriandika/laravel-settings

Laravel 5 Persistent Settings

6039.6k1](/packages/efriandika-laravel-settings)[oriceon/laravel-settings

Laravel 5 persistent settings

207.1k1](/packages/oriceon-laravel-settings)[illuminatech/nova-config

A Laravel Nova tool for application configuration management.

134.2k](/packages/illuminatech-nova-config)

PHPackages © 2026

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