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

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

darshphpdev/laravel-settings
============================

A flexible Laravel package for managing application settings with support for file or database storage, encryption, and array format customization.

v1.0.0(1y ago)10323MITPHPPHP ^7.4|^8.0

Since Feb 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DarshPhpDev/laravel-settings)[ Packagist](https://packagist.org/packages/darshphpdev/laravel-settings)[ RSS](/packages/darshphpdev-laravel-settings/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

[![Laravel Settings](/art/socialcard.png)](/art/socialcard.png)

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

[](#laravel-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6776b0ba35b2389686502804b4d3a076e4dbe429191a0a4bc4a92e3bb370bcf7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64617273687068706465762f6c61726176656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darshphpdev/laravel-settings)[![Total Downloads](https://camo.githubusercontent.com/b22f2ea7aaa4bab79c252c248a8862892dcbc5f377490d9ce30552bd11afdff6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64617273687068706465762f6c61726176656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darshphpdev/laravel-settings)[![License](https://camo.githubusercontent.com/88e1dabf4d223df0950e0985948e231325fefca9fa7fe9e446cf8b1c5e9d9e47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e)](LICENSE)

A flexible Laravel package for managing application settings with support for file or database storage, encryption, and array format customization.

✨ Features
----------

[](#-features)

- 💾 Multiple storage drivers (file or database)
- 🔐 Value encryption support
- 📦 Configurable array storage formats (JSON, CSV, or serialized)
- 🛠️ Simple helper function for easy access
- ⚡ Laravel artisan command for easy installation
- 🚀 Cache support for better performance

📋 Requirements
--------------

[](#-requirements)

- 🐘 PHP 7.4|8.0
- ⚡ Laravel 7.0|8.0|9.0|10.0|11.0

📥 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require darshphpdev/laravel-settings
```

🔧 Setup
-------

[](#-setup)

1. Run the installation command:

```
php artisan settings:install
```

[![Artisan Command](/art/artisan.png)](/art/artisan.png)

This command will:

- 🎯 Guide you through configuration options
- 📝 Create the config file
- 🔄 Publish migrations (if using database driver)

2. If using database driver, run migrations:

```
php artisan migrate
```

⚙️ Configuration
----------------

[](#️-configuration)

The package configuration will be published to `config/settings.php`. Here are the available options:

```
return [
    // Storage driver: 'file' or 'database'
    'driver' => 'file',

    // Enable encryption for stored values
    'encrypt' => false,

    // Format for storing arrays: 'json', 'csv', 'serialize'
    'array_format' => 'json',

    // File storage settings
    'file' => [
        'path' => storage_path('app/settings.json'),
    ],

    // Database storage settings
    'database' => [
        'table' => 'settings',
    ],

    // Cache configurations
    'cache' => [
        'key' => 'laravel-settings',
        'ttl' => 3600,
        'enabled' => true,
    ]
];
```

📖 Usage
-------

[](#-usage)

### 🔨 Using Helper Function

[](#-using-helper-function)

```
// Get a setting
settings()->get('site_name', 'Default site name');

// Set a setting
settings()->set('site_name', 'My Awesome Site');

// Set multiple settings
settings()->set('site_meta', [
    'name' => 'My Awesome Site',
    'description' => 'A great site'
]);

// Get all settings
$settings = settings()->all();

// Check if a setting exists
settings()->has('site_name');

// Remove a setting
settings()->forget('site_name');

// Clear all settings
settings()->clear();
```

### 📦 Working with Arrays

[](#-working-with-arrays)

The package provides three formats for storing arrays:

1. **JSON** (default) 📄:

```
settings()->set('my_array', ['one', 'two']); // Stored as JSON
```

2. **CSV** 📑:

```
settings()->set('my_array', ['one', 'two']); // Stored as "one,two"
```

3. **Serialized** 📎:

```
settings()->set('my_array', ['one', 'two']); // Stored using PHP serialization
```

### 🔐 Encryption

[](#-encryption)

When encryption is enabled in the config, all values are automatically encrypted before storage and decrypted when retrieved:

```
// With encryption enabled
settings()->set('secret_key', 'sensitive-value'); // Stored encrypted
```

🛡️ Security
-----------

[](#️-security)

If you discover any security-related issues, please email  instead of using the issue tracker.

👨‍💻 Credits
-----------

[](#‍-credits)

- [Mustafa Ahmed](https://github.com/darshphpdev)

📄 License
---------

[](#-license)

This package is open-source software licensed under the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance41

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% 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

Unknown

Total

1

Last Release

489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dc427456706f88e785b5ded5d2e9673e9bc7fa8a742b5949a62db0272de5181?d=identicon)[DarshPhpDev](/maintainers/DarshPhpDev)

---

Top Contributors

[![DarshPhpDev](https://avatars.githubusercontent.com/u/29954627?v=4)](https://github.com/DarshPhpDev "DarshPhpDev (17 commits)")[![shehab-waleed](https://avatars.githubusercontent.com/u/105127567?v=4)](https://github.com/shehab-waleed "shehab-waleed (2 commits)")

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M267](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M989](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M362](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)

PHPackages © 2026

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