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

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

jomigomes/laravel-settings
==========================

A flexible Laravel package for managing scoped, typed settings with a manifesto-based configuration approach

2.1.2(5mo ago)112MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Jan 7Pushed 5mo agoCompare

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

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Settings Package
========================

[](#laravel-settings-package)

[![Latest Version](https://camo.githubusercontent.com/91b0bc04f8076f796bd0bdf0f791b2a1b47fcd1f7add0473d6ab07e15141e7a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6d69676f6d65732f6c61726176656c2d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jomigomes/laravel-settings)[![Total Downloads](https://camo.githubusercontent.com/f77a663713881bb8ab27a66538a8118b6050f50f4e3df95e6004939f63535b0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f6d69676f6d65732f6c61726176656c2d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jomigomes/laravel-settings)[![License](https://camo.githubusercontent.com/2772fb31b3de19f0afba783ad9ab75186130636c70246f52231b3f336220f684/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f6d69676f6d65732f6c61726176656c2d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jomigomes/laravel-settings)

A flexible Laravel package for managing scoped, typed settings with a manifesto-based configuration approach.

Features
--------

[](#features)

- **Scoped Settings**: Associate settings with specific models or application segments
- **Type Safety**: Automatic type casting and validation for various data types
- **Manifesto-Based**: Single source of truth for settings structure and defaults
- **Default Values**: Settings are stored in config until changed, preventing database clutter
- **Flexible Organization**: Support for nested groups and dot notation access
- **Model Integration**: Easy integration with Eloquent models via the `HasSettings` trait
- **Events System**: Listen to setting lifecycle events (retrieved, created, updated, deleted)
- **Facade Support**: Clean API with `Settings` facade
- **CLI Commands**: Manage settings via artisan commands
- **Optional Caching**: Performance optimization with configurable cache layer

Supported Types
---------------

[](#supported-types)

- Integer
- Double
- Boolean
- String
- Array
- Collection (Illuminate\\Support\\Collection)
- Datetime (Carbon instances)
- Object

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

[](#installation)

Install the package via Composer:

```
composer require jomigomes/laravel-settings
```

Publish the configuration file:

```
php artisan vendor:publish --tag=settings-config
```

Publish and run the migration:

```
php artisan vendor:publish --tag=settings-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

The package uses a "manifesto" file (`config/settings.php`) as the single source of truth for all settings. Define your settings structure here:

```
use JomiGomes\LaravelSettings\Models\Setting;

return [
    'system' => [
        'features' => [
            'enable_notifications' => [
                'value' => true,
                'type' => Setting::TYPE_BOOLEAN,
            ],
        ],
    ],

    'user' => [
        'preferences' => [
            'theme' => [
                'value' => 'light',
                'type' => Setting::TYPE_STRING,
            ],
        ],
    ],
];
```

Usage
-----

[](#usage)

### Non-Model Related Settings

[](#non-model-related-settings)

```
use JomiGomes\LaravelSettings\Facades\Settings;
// Or use the model directly:
// use JomiGomes\LaravelSettings\Models\Setting;

// Get a setting
$setting = Settings::get('features.enable_notifications', 'system');

// Set a setting
Settings::set('features.enable_notifications', false, 'system');

// Get all settings for a scope
$allSettings = Settings::getAllScoped('system');

// Get filtered settings
$features = Settings::getFiltered('system', 'features');
```

### Model Related Settings

[](#model-related-settings)

First, add the `HasSettings` trait to your model:

```
use JomiGomes\LaravelSettings\Traits\HasSettings;

class User extends Model
{
    use HasSettings;
}
```

Then use settings with your model:

```
$user = User::find(1);

// Get a setting
$theme = $user->getSetting('preferences.theme');

// Set a setting
$user->setSetting('preferences.theme', 'dark');

// Get all settings
$allSettings = $user->getAllSettings();

// Get filtered settings
$preferences = $user->getFilteredSettings('preferences');
```

### Events

[](#events)

Listen to setting changes in your `EventServiceProvider`:

```
use JomiGomes\LaravelSettings\Events\SettingUpdated;

protected $listen = [
    SettingUpdated::class => [
        LogSettingChange::class,
    ],
];
```

Available events:

- `SettingRetrieved` - Fired when a setting is accessed
- `SettingCreated` - Fired when a new setting is stored
- `SettingUpdated` - Fired when an existing setting changes
- `SettingDeleted` - Fired when a setting reverts to default

### Artisan Commands

[](#artisan-commands)

```
# List all settings
php artisan settings:list

# List settings for a specific scope
php artisan settings:list user

# List with filter
php artisan settings:list user --filter=preferences

# Show only customized settings
php artisan settings:list user --only-custom

# Clear all customized settings
php artisan settings:clear --force

# Clear settings for a scope
php artisan settings:clear user

# Clear with filter
php artisan settings:clear user --filter=preferences
```

### Caching

[](#caching)

Enable caching for improved performance in your `.env`:

```
SETTINGS_CACHE_ENABLED=true
SETTINGS_CACHE_TTL=3600
```

Or in `config/settings.php`:

```
'cache' => [
    'enabled' => true,
    'ttl' => 3600, // seconds
],
```

Documentation
-------------

[](#documentation)

For complete documentation, see the [Settings.md](docs/Settings.md) file included in this package.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

Credits
-------

[](#credits)

Created by João Gomes

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance70

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

5

Last Release

176d ago

Major Versions

v1.0.0 → 2.0.02026-01-08

PHP version history (2 changes)v1.0.0PHP ^8.1|^8.2|^8.3

2.1.1PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/122524697?v=4)[JoMiGomes](/maintainers/JoMiGomes)[@JoMiGomes](https://github.com/JoMiGomes)

---

Top Contributors

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

---

Tags

laravelconfigurationSettingstyped-settingsscoped-settings

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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