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

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

danielefavi/laravel-settings
============================

Laravel package for handling your APP settings.

1.0.2(4y ago)113MITPHPPHP ^7.2|^8.0

Since Jun 27Pushed 4y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Laravel Settings
================

[](#laravel-settings)

**Laravel Settings** is PHP package for laravel for handling the generic settings of your application.

With *Laravel Settings* you can store any type of values in the database.

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

[](#installation)

```
composer require danielefavi/laravel-settings
```

Usage
-----

[](#usage)

Once the package is installed you can get the `Setting` model instace from the app service provider like this `app('settings')` or just call `settings()` (that is wrapper around `app('settings')`).

### Setting a value

[](#setting-a-value)

```
settings()->set('code_langs', ['php', 'javascript', 'python']);

// this does the same of the previous line of code
app('settings')->set('max_connection', 100);
```

### Getting a value

[](#getting-a-value)

```
$codeLangs = settings()->get('code_langs');
// codeLangs = Array( [0] => php [1] => javascript [2] => python )

$maxConn = settings()->get('max_connection');
```

When getting a function you can specify a default value as well.

```
// if the setting max_connection is not found then it returns 999
$maxConn = settings()->get('max_connection', 999);
```

### Increment a value

[](#increment-a-value)

```
settings()->set('counter', 10); // the counter is 10

settings()->inc('counter'); // incrementing the counter by 1, so the counter is 11
settings()->inc('counter'); // incrementing the counter by 1, so the counter is 12
settings()->inc('counter', 3); // incrementing the counter by 3, so the counter is 15

$counter = settings()->get('counter'); // counter == 15
```

### Decrementing a value

[](#decrementing-a-value)

```
settings()->set('counter', 10); // the counter is 10

settings()->dec('counter'); // decrementing the counter by 1, so the counter is 9
settings()->dec('counter', 4); // decrementing the counter by 5, so the counter is 5

$counter = settings()->get('counter'); // counter == 5
```

### Appending (or attaching) a value to a setting

[](#appending-or-attaching-a-value-to-a-setting)

With the `attach` method you can add values to an existing array or string. If the array or string does not exist then it will be created.

Appending values to an array.

```
settings()->attach('tags', ['tag-1', 'tag-2']); // attaching (or creating) the array
settings()->attach('tags', ['tag-3', 'tag-4']); // attaching an array to the array
settings()->attach('tags', 'tag-5'); // attaching a value to the array

$tags = settings()->get('tags');
// tags contains tag-1, tag-2, tag-3, tag-4, tag-5
```

Appending values to a string.

```
settings()->set('names', 'John');
settings()->attach('names', ',Doe,Wan');
settings()->attach('names', ',Clare');

$names = settings()->get('names'); // John,Doe,Wan,Clare
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

1780d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31dc2af9124d4f028395fc040b9f07f31e93f9f395f37ed3bf4c10c87f708fe0?d=identicon)[DanieleFavi](/maintainers/DanieleFavi)

---

Top Contributors

[![danielefavi](https://avatars.githubusercontent.com/u/7241290?v=4)](https://github.com/danielefavi "danielefavi (5 commits)")

---

Tags

laravelSettingssettinglaravel-settings

### Embed Badge

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

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

###  Alternatives

[akaunting/laravel-setting

Persistent settings package for Laravel

495805.1k7](/packages/akaunting-laravel-setting)

PHPackages © 2026

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