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

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

phu1237/laravel-settings
========================

Laravel Settings

v1.1.5(3y ago)3306MITPHP

Since Jan 24Pushed 3y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

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

[](#laravel-settings)

[![Banner](https://camo.githubusercontent.com/68e65d93f76e99cb83b7238f0bf8ef9343da98012c9befebbde82e342457fe72/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323053657474696e67732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d706875313233372532466c61726176656c2d73657474696e6773267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d476c6f62616c2b73657474696e672b666f722b6c61726176656c266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/68e65d93f76e99cb83b7238f0bf8ef9343da98012c9befebbde82e342457fe72/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323053657474696e67732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d706875313233372532466c61726176656c2d73657474696e6773267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d476c6f62616c2b73657474696e672b666f722b6c61726176656c266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)[![Version](https://camo.githubusercontent.com/785d6e8d3f16934736895c2664bb5ead15cb72e9d36493a6ba1fe15ecfad79a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706875313233372f6c61726176656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phu1237/laravel-settings)[![License](https://camo.githubusercontent.com/f993612bba5b12330f9e3600c55864ead5319dbbd144b5f46364d113e871a5bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706875313233372f6c61726176656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://github.com/Phu1237/laravel-settings/blob/master/LICENSE)

Global setting for Laravel. Can use in controllers, blades, etc.

Content table
-------------

[](#content-table)

- [Installation](#installation)
- [Usage](#usage)
    - [Facade](#facade)
    - [Helpers](#helpers)
- [Command](#command)
- [Test](#test)
- [License](#license)

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

[](#installation)

- Require this package with composer:

```
composer require phu1237/laravel-settings
```

### Laravel auto-discovery

[](#laravel-auto-discovery)

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

### Laravel without auto-discovery

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php:

```
Phu1237\LaravelSettings\ServiceProvider::class,
```

If you want to use the facade, add this to your facades in app.php:

```
'Setting' => Phu1237\LaravelSettings\Facades\Setting::class,
```

Or use this package facade

```
use Phu1237\LaravelSettings\Facades\Setting;
```

- Then run migrate to create settings table:

```
php artisan migrate
OR
php artisan migrate --path=vendor/phu1237/laravel-settings/database/migrations
```

- Done. You can use all functions now.

Usage
-----

[](#usage)

**Example setting row:**[![Screenshot](screenshot.png)](screenshot.png)

You can use both **Facade** and **Helpers** to get or set the setting.

### Facades

[](#facades)

```
// Get
Setting::all(); // Get all settings items
Setting::get('key'); // Get settings item
Setting::value('key'); // Get settings item value
Setting::value('key', 'default'); // Get settings item value with default
Setting::meta('key'); // Get meta
Setting::meta('key', 'attribute'); // Get meta attribute
Setting::meta('key', 'attribute', 'default'); // Get meta attribute with default
// Set
Setting::set('key', 'value');
Setting::set(['key' => 'value']);
Setting::value('key', 'value');
Setting::value(['key' => 'value']);
Setting::meta('key', 'attribute', 'value');
Setting::meta('key', ['attribute' => 'value']);
// Other
Setting::has('key');
Setting::forget('key');
Setting::forget(['key1', 'key2']);
```

### Helpers

[](#helpers)

To get field from setting:

```
// Get settings manager
settings('key');
settings()->get('key');
// Get value of setting
settings()->value('key');
settings()->value('key', 'default value');
// Get meta(s) from setting
settings()->meta('key');
settings()->meta('key', 'attribute');
settings()->meta('key', 'attribute', 'default value');
```

To set field value to setting:

```
// Set value for single key
settings()->set('key', 'value');
// Set value for single or multiple key(s)
settings([
    'key1' => 'value1',
    'key2' => 'value2'
]);
settings()->value([
    'key1' => 'value1',
    'key2' => 'value2'
]);
settings()->set([
    'key1' => 'value1',
    'key2' => 'value2'
]);
// Set meta for single or multiple attribute(s)
settings()->meta('key', [
    'attribute1' => 'value1',
    'attribute2' => 'value2'
]);
```

Other:

```
// Get all settings
settings()->all();
// Check if setting exists or not
settings()->has('key');
// Update or create with key(string), value(string), meta(array)
settings()->store('key', 'value', 'meta');
// Forget (Destroy) setting
settings()->forget('key');
settings()->forget(['key1', 'key2']);
settings()->flush();
```

### Blade directive

[](#blade-directive)

Get setting value:

```
@setting('key', 'default value')
@setting_meta('key', 'meta', 'default value')
```

### Blade component

[](#blade-component)

```

```

Command
-------

[](#command)

Publish all package files:

```
php artisan settings:publish
```

Copy the package config to your local config with the publish command:

```
php artisan vendor:publish --provider="Phu1237\LaravelSettings\ServiceProvider" --tag=config
```

Copy the package tests to your local tests with the publish command:

```
php artisan vendor:publish --provider="Phu1237\LaravelSettings\ServiceProvider" --tag=tests
```

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

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

Recently: every ~131 days

Total

7

Last Release

1189d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35699642de493def4cbd243213cc0df128b81e2b9f0f360ee10bc3d0c014e7ad?d=identicon)[Phu1237](/maintainers/Phu1237)

---

Top Contributors

[![Phu1237](https://avatars.githubusercontent.com/u/9032235?v=4)](https://github.com/Phu1237 "Phu1237 (17 commits)")

---

Tags

laravelphu1237settings

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[felixnagel/t3extblog

A record based blog extension for TYPO3 CMS. Easy to use and packed with features (incl. comments, subscriptions for comments and posts, Wordpress like subscription manager, reasonable email sending in FE and BE, GDPR ready, BE modules, Dashboard widgets, RSS, Sitemap, ...). Flexible and powerful!

3421.6k](/packages/felixnagel-t3extblog)

PHPackages © 2026

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