PHPackages                             amdadulhaq/setting-laravel - 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. amdadulhaq/setting-laravel

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

amdadulhaq/setting-laravel
==========================

Setting option for Laravel

v2.1.0(1mo ago)23.9kMITPHPPHP ^8.2|^8.3|^8.4|^8.5CI failing

Since Dec 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/amdad121/setting-laravel)[ Packagist](https://packagist.org/packages/amdadulhaq/setting-laravel)[ Docs](https://github.com/amdad121/setting-laravel)[ GitHub Sponsors](https://github.com/amdad121)[ RSS](/packages/amdadulhaq-setting-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (9)Versions (8)Used By (0)

Setting option for Laravel
==========================

[](#setting-option-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f547e6f04d95397e7e6c9a08976a68d2fcbe4c731212ce5bd7d6a34efa96a9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d646164756c6861712f73657474696e672d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/amdadulhaq/setting-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fe122eb9286e48320388321824770fa47c21178e60728280d0cd56399d6c432c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d6461643132312f73657474696e672d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/amdad121/setting-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6a40912b2eb2287156b9a20dcf1fe77dea54e9d83a0899187bbf180efad2a394/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d6461643132312f73657474696e672d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/amdad121/setting-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d747e6e7e84860d732daf0b5c834e70debfa430c82ef0fa004a2641b7f67240c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d646164756c6861712f73657474696e672d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/amdadulhaq/setting-laravel)

A minimal and powerful settings package for Laravel with caching, type casting, and bulk operations.

Features
--------

[](#features)

- Simple key-value storage
- Automatic type casting (strings, integers, floats, booleans, arrays, JSON)
- Built-in caching for performance
- Bulk operations for setting/getting multiple values
- Facade support
- Configurable cache TTL
- Database storage

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

[](#installation)

You can install the package via composer:

```
composer require amdadulhaq/setting-laravel
```

### Requirements

[](#requirements)

- PHP 8.2, 8.3, 8.4, or 8.5
- Laravel 10, 11, 12, or 13

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="setting-laravel-migrations"
php artisan migrate
```

Optionally publish the config file:

```
php artisan vendor:publish --tag="setting-laravel-config"
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use AmdadulHaq\Setting\Facades\Setting;

Setting::set('app_name', 'Laravel');

return Setting::get('app_name');
// Laravel

Setting::remove('app_name');
// true

Setting::has('app_name');
// false
```

### Helper Function

[](#helper-function)

```
setting()->set('app_name', 'Laravel');

return setting()->get('app_name');
// Laravel

return setting()->remove('app_name');
// true
```

### Type Casting

[](#type-casting)

The package automatically casts values to their appropriate types:

```
setting()->set('string_value', 'Hello');
setting()->set('integer_value', 100);
setting()->set('float_value', 15.5);
setting()->set('boolean_value', true);
setting()->set('array_value', ['foo' => 'bar']);
setting()->set('json_value', ['nested' => ['key' => 'value']]);

setting()->get('integer_value'); // Returns: 100 (int)
setting()->get('boolean_value'); // Returns: true (bool)
setting()->get('array_value');   // Returns: ['foo' => 'bar'] (array)
```

### Default Values

[](#default-values)

```
setting()->get('nonexistent_key', 'default_value');
// default_value
```

### Bulk Operations

[](#bulk-operations)

```
// Set multiple settings at once
setting()->setMultiple([
    'app_name' => 'Laravel',
    'max_users' => 100,
    'maintenance_mode' => false,
]);

// Get multiple settings at once
$settings = setting()->getMultiple(['app_name', 'max_users']);
// ['app_name' => 'Laravel', 'max_users' => 100]
```

### Get All Settings

[](#get-all-settings)

```
$allSettings = setting()->all();
// Returns a Collection of all settings
```

### Cache Management

[](#cache-management)

```
// Manually flush the cache
setting()->flushCache();
```

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

[](#configuration)

The config file allows you to configure caching behavior:

```
return [
    'cache_enabled' => env('SETTING_CACHE_ENABLED', true),
    'cache_key' => env('SETTING_CACHE_KEY', 'settings.cache'),
    'cache_ttl' => env('SETTING_CACHE_TTL', 60 * 60 * 24), // 24 hours
];
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Amdadul Haq](https://github.com/amdad121)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance90

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~156 days

Total

7

Last Release

52d ago

Major Versions

v1.2.1 → v2.0.02026-01-01

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

v2.0.0PHP ^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/7219b32db58e53dddb8a970aec40c9a41ec7d6dbf3570fd89ac14abe7424532e?d=identicon)[amdadulhaq](/maintainers/amdadulhaq)

---

Top Contributors

[![amdad121](https://avatars.githubusercontent.com/u/11732880?v=4)](https://github.com/amdad121 "amdad121 (26 commits)")

---

Tags

configurationlaravelsettingslaravelAmdadul Haqsetting-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/amdadulhaq-setting-laravel/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)

PHPackages © 2026

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