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

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

oriceon/laravel-settings
========================

Laravel 5 persistent settings

1.6.2(4y ago)207.2k71MITPHPPHP &gt;=5.5.9CI failing

Since May 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/oriceon/laravel-settings)[ Packagist](https://packagist.org/packages/oriceon/laravel-settings)[ RSS](/packages/oriceon-laravel-settings/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (5)Versions (9)Used By (1)

[![Build Status](https://camo.githubusercontent.com/23e975ac94fd78df71b69fef12481801ae2ba5c825abba8f6471471ba7ad643b/68747470733a2f2f7472617669732d63692e6f72672f6f726963656f6e2f6c61726176656c2d73657474696e67732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/oriceon/laravel-settings)[![Latest Stable Version](https://camo.githubusercontent.com/b8a559adf24c40abdf40a77639c1b3918d42131b0796db90004c7691fbd40650/68747470733a2f2f706f7365722e707567782e6f72672f6f726963656f6e2f6c61726176656c2d73657474696e67732f762f737461626c652e737667)](https://packagist.org/packages/oriceon/laravel-settings)[![Total Downloads](https://camo.githubusercontent.com/f418dfaeea24400549da9df5a1243f6e35292fa816c1d47d95bbbd160f99e24f/68747470733a2f2f706f7365722e707567782e6f72672f6f726963656f6e2f6c61726176656c2d73657474696e67732f646f776e6c6f6164732e737667)](https://packagist.org/packages/oriceon/laravel-settings)[![License](https://camo.githubusercontent.com/d99f8ae706ec261e742e1881576e053e7155488b5e9c5cccc926b3c052a77a43/68747470733a2f2f706f7365722e707567782e6f72672f6f726963656f6e2f6c61726176656c2d73657474696e67732f6c6963656e73652e737667)](https://packagist.org/packages/oriceon/laravel-settings)

Laravel-Settings
================

[](#laravel-settings)

Laravel 5.4.x persistent settings using JSON cache file

Install process
===============

[](#install-process)

1. Require this package with composer :

    `composer require oriceon/laravel-settings`
2. Register the ServiceProvider to the `providers` array in `config/app.php`

    `Oriceon\Settings\SettingsServiceProvider::class,`
3. Add an alias for the facade to `aliases` array in your `config/app.php`

    `'Settings'  => Oriceon\Settings\Facades\Settings::class,`
4. Publish the config and migration files now:

    `php artisan vendor:publish --provider="Oriceon\Settings\SettingsServiceProvider" --force`

Change `config/settings.php` according to your needs.

Create the `settings` table.

```
php artisan migrate

```

How to Use it?
==============

[](#how-to-use-it)

### Set a value

[](#set-a-value)

```
Settings::set('key', 'value');
Settings::set('key1.key2', 'value');

```

### Get a value

[](#get-a-value)

```
$value = Settings::get('key');
$value = Settings::get('key1.key2');

```

### Get a value with Default Value.

[](#get-a-value-with-default-value)

```
$value = Settings::get('key', 'Default Value');

```

### Get all settings

[](#get-all-settings)

```
$values = Settings::getAll();

```

> Note: default, all settings are loaded from cache. If you want to load them from database with this method just call with a parameter:

```
$values = Settings::getAll($cache = false);

```

> Note: If key is not found (null) in cache or settings table, it will return default value

### Has a key

[](#has-a-key)

```
$value = Settings::has('key');
$value = Settings::has('key1.key2');

```

### Forget a value

[](#forget-a-value)

```
Settings::forget('key');
Settings::forget('key1.key2');

```

### Clean and update settings from config file

[](#clean-and-update-settings-from-config-file)

```
Settings::clean();
Settings::clean(['flush' => true]);

```

> Note: using flush parameter, will forget all values and reload settings from config file

### Forget all values

[](#forget-all-values)

```
Settings::flush();

```

Fallback to Laravel config
--------------------------

[](#fallback-to-laravel-config)

```
// Change your config/settings.php
'fallback' => true

```

### Example

[](#example)

```
/*
 * If the value with key => mail.host is not found in cache or DB of Larave Settings
 * it will return same value as config::get('mail.host');
 */
Settings::get('mail.host');

```

Primary config file
-------------------

[](#primary-config-file)

```
// Change your config/settings.php
'primary_config_file' => 'filename'

```

> Note: If you want to have a site config file with all your default settings, create a file in config/ with desired name and create your config file as you want. After that, you may no longer need to enter the file name in setting calls.
>
> > Instead Settings::get('filename.setting\_key') you will just call for Settings::get('setting\_key')

> Note: It will work if default value in laravel setting is not set

### Get a value via an helper

[](#get-a-value-via-an-helper)

```
$value = settings('key');
$value = settings('key', 'default value');

```

Credits to main author
======================

[](#credits-to-main-author)

Fwork package : [ABENEVAUT/laravel-settings](https://github.com/ABENEVAUT/laravel-settings)

Original package : [efriandika/laravel-settings](https://github.com/efriandika/laravel-settings)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 84.8% 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 ~218 days

Recently: every ~315 days

Total

8

Last Release

1803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a9692bf91992f959404944cecec65e1b68b21491ec3c5642e67e47a836d9ea8?d=identicon)[oriceon](/maintainers/oriceon)

---

Top Contributors

[![oriceon](https://avatars.githubusercontent.com/u/358823?v=4)](https://github.com/oriceon "oriceon (28 commits)")[![codetheorist](https://avatars.githubusercontent.com/u/22813671?v=4)](https://github.com/codetheorist "codetheorist (3 commits)")[![daneswood-matt](https://avatars.githubusercontent.com/u/48827439?v=4)](https://github.com/daneswood-matt "daneswood-matt (1 commits)")[![threeel](https://avatars.githubusercontent.com/u/680311?v=4)](https://github.com/threeel "threeel (1 commits)")

---

Tags

laravel-5-packagelaravel54laravelSettingspersistent

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43411.2k](/packages/venturedrake-laravel-crm)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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