PHPackages                             dd4you/lgs - 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. [Caching](/categories/caching)
4. /
5. dd4you/lgs

ActiveLibrary[Caching](/categories/caching)

dd4you/lgs
==========

Store general settings like website name, logo url, contacts in the database easily. Everything is cached, so no extra query is done

v1.0.2(1y ago)15982MITPHP

Since Mar 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DD4You/laravel-lgs)[ Packagist](https://packagist.org/packages/dd4you/lgs)[ RSS](/packages/dd4you-lgs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (2)

[![Latest Stable Version](https://camo.githubusercontent.com/08954020ad507f2a5756590432fb2581f0b9eb5d70a031542631b5fa29c4765e/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f76)](https://packagist.org/packages/dd4you/lgs)[![Daily Downloads](https://camo.githubusercontent.com/569303e389f133205213e6ffa6afed67c40e342de24f0c2df9fc6c45cac518c6/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f642f6461696c79)](https://packagist.org/packages/dd4you/lgs)[![Monthly Downloads](https://camo.githubusercontent.com/df2b28d2eb45dd7e0445bbb6f692e479ce50bf6fb7f08dbc7b67da33e848fa86/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f642f6d6f6e74686c79)](https://packagist.org/packages/dd4you/lgs)[![Total Downloads](https://camo.githubusercontent.com/7597f2b7edc48114684a9b6a39a414ebfca67dad5bd7e11ba3dc341640f3b8ba/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f646f776e6c6f616473)](https://packagist.org/packages/dd4you/lgs)[![License](https://camo.githubusercontent.com/25b68330ad6e36a8c290083b02c17f9b41451bf35a18f049856f38d35ad15e78/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f6c6963656e7365)](https://packagist.org/packages/dd4you/lgs)[![PHP Version Require](https://camo.githubusercontent.com/bcb524b7426ffeb7f1c8cacb0cd530741777dcefd03ee2d04f117519b94fefff/687474703a2f2f706f7365722e707567782e6f72672f646434796f752f6c67732f726571756972652f706870)](https://packagist.org/packages/dd4you/lgs)

Laravel Global Settings
=======================

[](#laravel-global-settings)

Store general settings like website name, logo url, contacts in the database easily. Everything is cached, so no extra query is done. You can also get fresh values from the database directly if you need.

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

[](#installation)

Install the package via composer

```
composer require dd4you/lgs
```

Setup

```
php artisan dd4you:install-lgs
```

Migrate the database

```
php artisan migrate
```

I have also added seeder for some general settings a website needs. Seed the database using command:

```
php artisan db:seed --class=SettingsSeeder

```

Usage/Examples
--------------

[](#usageexamples)

To store settings on database

```
settings()->set(
        'key',
        ['label'=>'Label Name','value'=>'Value Name']
    );

```

You can also set multiple settings at once

```
settings()->set([
        'key1'=>[
            'label'=>'Label Name',
            'value'=>'Value Name',
            'type'=>settings()->fileType()
            ],
        'key2'=>[
            'label'=>'Label Name',
            'value'=>'Value Name'
            ],
    ]);

```

You can retrieve the settings from cache using any command below

```
settings('key');
settings()->get('key');
settings()->get(['key1', 'key2']);

```

Want the settings directly from database? You can do it,

```
settings('key',true);
settings()->get('key',true);
settings()->get(['key1', 'key2'],true);

```

Getting all the settings stored on database

```
settings()->getAll();

```

You can use the settings on blade as

```
{{ settings('site_name')['value'] }}

```

Or, if you have html stored on settings

```
{!! settings('footer_text')['value'] !!}
{!! settings('footer_text')['value'] Copyright Date('Y') !!}

```

Finally, If you have changed something directly on database, Don't forget to clear the cache.

```
php artisan cache:clear

```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

Feedback
--------

[](#feedback)

If you have any feedback, please reach out at  or submit a pull request here.

Authors
-------

[](#authors)

- [@dd4you](https://www.github.com/DD4You)

Badges
------

[](#badges)

[![MIT License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://choosealicense.com/licenses/mit/)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~291 days

Total

3

Last Release

576d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d73b4fd4e458f8874fda4fbf463e72f42e0a01f7530c8d40db864fef798fd5d?d=identicon)[DD4You](/maintainers/DD4You)

---

Top Contributors

[![vinayrajput05](https://avatars.githubusercontent.com/u/84115475?v=4)](https://github.com/vinayrajput05 "vinayrajput05 (3 commits)")[![DD4You](https://avatars.githubusercontent.com/u/41217230?v=4)](https://github.com/DD4You "DD4You (1 commits)")

---

Tags

laravelSettingslaravel-settingsglobal settingslaravel global settings

### Embed Badge

![Health badge](/badges/dd4you-lgs/health.svg)

```
[![Health](https://phpackages.com/badges/dd4you-lgs/health.svg)](https://phpackages.com/packages/dd4you-lgs)
```

###  Alternatives

[glorand/laravel-model-settings

Model Settings for your Laravel app

9041.1M4](/packages/glorand-laravel-model-settings)

PHPackages © 2026

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