PHPackages                             leantony/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. leantony/laravel\_settings

ActiveLibrary

leantony/laravel\_settings
==========================

Dynamically load laravel config settings from config files into a database

0145PHP

Since May 3Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#laravel-settings)

This package will allow managing of laravel config variables, from the database.

Requirements
------------

[](#requirements)

- Laravel 5.1+
- Cache with tags support, e.g redis, memcached, etc

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

[](#installation)

- Install the package from composer

`composer install leantony/laravel_settings:dev-master`

- Add the service provider to app.php

```
Leantony\Settings\Providers\ServiceProvider::class
```

- Publish configuration, and migration

```
php artisan vendor:publish --provider="Leantony\Settings\Providers\ServiceProvider" --tag="config"
```

> This will copy `app_settings.php` into the config directory

```
php artisan vendor:publish --provider="Leantony\Settings\Providers\ServiceProvider" --tag="migrations"
```

> This will copy the migrations over to your migrations

> By default, only the values in `app.php` and `mail.php` will be included in the database. So be sure to read through and edit the file `app_settings.php` file, as you wish

- Run migrations `php artisan migrate`
- You're done!

Usage
-----

[](#usage)

The installation on its own does not persist the config values to the database. To persist the values from config files into the database, the package provides the following commands.

```
php artisan manage:settings --setup
```

> Will persist the config values into the database according to the setup defined in `app_settings.php`

```
php artisan manage:settings --bind
```

> Will bind settings in the database to those in actual laravel config. Hence settings in the database can also be normally accessed using the `config()` helper.

To ensure that the above is done automatically at boot, add the following method to your `AppServiceProvider` boot method.

```
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
      // this method will ensure that settings persisted in the database are always
      // loaded into laravel config, at runtime
      app('settings')->replaceLoaded();

      // to sensure that the settings are refreshed when the database values change, add this method
      Leantony\Settings\SettingsHelper::observe();
    }
```

Fetching settings
=================

[](#fetching-settings)

Apart from using laravel config helper once binding is done, the package provides a helper method `settings()`. Use it as shown below

> If no argument is provided to the method, an instance of `Leantony\Settings\SettingsHelper` is returned

To fetch a setting from the database, with a key of `environment`, and category of `app`, you will append the category to the key value (camelcased), as follows

```
settings()->appEnvironment
```

You can also do it like this

```
settings('app.environment')
```

To fetch all settings by a category:

```
settings('app')

// or

settings()->getByCategory('app')
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/78dd5b6393580ed9a6be5b673dd1c5e2ed09e53b91c77f64fd6c815acd902057?d=identicon)[leantony](/maintainers/leantony)

---

Top Contributors

[![leantony](https://avatars.githubusercontent.com/u/7967272?v=4)](https://github.com/leantony "leantony (28 commits)")

---

Tags

laravel-settings

### Embed Badge

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

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

PHPackages © 2026

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