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

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

hrace009/laravel-settings
=========================

Laravel Persistent Settings

1.0.3(7mo ago)130MITPHPPHP &gt;=5.5.9

Since Dec 1Pushed 7mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

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

[](#laravel-settings)

Laravel Persistent Settings (Database + Cache)

Re-Publish new migration file

```
$ php artisan vendor:publish --provider="hrace009\LaravelSettings\SettingsServiceProvider" --force

```

And run

```
$ php artisan migrate

```

How to Install
--------------

[](#how-to-install)

Require this package with composer ([Packagist](https://packagist.org/packages/hrace009/laravel-settings)) using the following command:

```
composer require hrace009/laravel-settings

```

or modify your `composer.json`:

```
   "require": {
      "hrace009/laravel-settings": "1.*"
   }

```

then run `composer update`:

After updating composer, Register the ServiceProvider to the `providers` array in `config/app.php`

```
'hrace009\LaravelSettings\SettingsServiceProvider',

```

Add an alias for the facade to `aliases` array in your `config/app.php`

```
'Settings'  => hrace009\LaravelSettings\Facades\Settings::class,

```

Publish the config and migration files now (Attention: This command will not work if you don't follow previous instruction):

```
$ php artisan vendor:publish --provider="hrace009\LaravelSettings\SettingsServiceProvider" --force

```

Change `config/settings.php` according to your needs. If you change `db_table`, don't forget to change the table's name in the migration file as well.

Create the `settings` table.

```
$ php artisan migrate

```

How to Use it?
--------------

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

Set a value

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

```

Get a value

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

```

Get a value with Default Value.

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

```

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

Get a value via an helper

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

```

Forget a value

```
Settings::forget('key');

```

Forget all values

```
Settings::flush();

```

Fallback to Laravel Config (available in v1.0.1)
------------------------------------------------

[](#fallback-to-laravel-config-available-in-v101)

How to activate?

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

```

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');

```

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

### Changelogs

[](#changelogs)

v1.0.1 - Dec 4th, 2021

- Second Release

---

v1.0.0 - Dec 1st, 2021

- First Release

### To Do

[](#to-do)

-

### License

[](#license)

The Laravel 5 Persistent Settings is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance63

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

4

Last Release

224d ago

### Community

Maintainers

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

---

Top Contributors

[![hrace009](https://avatars.githubusercontent.com/u/7691118?v=4)](https://github.com/hrace009 "hrace009 (8 commits)")

---

Tags

laravelphpsettingslaravelSettingspersistent

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)[edvinaskrucas/settings

Persistent settings package for Laravel framework.

22483.1k1](/packages/edvinaskrucas-settings)[oriceon/laravel-settings

Laravel 5 persistent settings

207.1k1](/packages/oriceon-laravel-settings)

PHPackages © 2026

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