PHPackages                             qh-8/laravel-options - 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. qh-8/laravel-options

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

qh-8/laravel-options
====================

Store Laravel application options

v2.4.0(2y ago)11873[1 issues](https://github.com/qh-8/laravel-options/issues)MITPHPPHP ^8.0|^8.1|^8.2

Since Jul 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/qh-8/laravel-options)[ Packagist](https://packagist.org/packages/qh-8/laravel-options)[ Docs](https://github.com/qh-8/laravel-options)[ RSS](/packages/qh-8-laravel-options/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (12)Used By (0)

Laravel Options
===============

[](#laravel-options)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bd2ce1c232adeef2c9b9e70df7fe5f8339d0462f0cc4e8ac96b7aa8d95301258/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f71682d382f6c61726176656c2d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/qh-8/laravel-options)[![Total Downloads](https://camo.githubusercontent.com/b9b4dbfcea6872f5e5685afa90f922876fd1008dddde9a52483f69c6831b2176/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f71682d382f6c61726176656c2d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/qh-8/laravel-options)[![GitHub Actions](https://github.com/qh-8/laravel-options/actions/workflows/run-tests.yml/badge.svg)](https://github.com/qh-8/laravel-options/actions/workflows/run-tests.yml/badge.svg)

This package allows you to store options in a repository (database).

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

[](#installation)

You can install the package via composer:

```
composer require qh-8/laravel-options
```

Usage
-----

[](#usage)

Publish the migration file

```
php artisan vendor:publish --tag=option-migrations
```

Publish the config file

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

Create the `options` table via artisan migrate command

```
php artisan migrate
```

Basic usage

```
// Via helper.
option('key', 'default'); // Get an option with default value.
option(['key' => 'default']); // Set options.
option()->save(); // Delete, update or insert to database.

// Via service.
$this->app['options']->has('key'); // Check option exists.
$this->app['options']->get('key', 'default'); // Get an option with default.
$this->app['options']->set('key', 'value'); // Set an option.
$this->app['options']->set(['key' => 'value']); // Set many options.
$this->app['options']->setMany(['key' => 'value']); // Set many options.
$this->app['options']->lock('key'); // Lock an option by key.
$this->app['options']->unlock('key'); // Unlock an option by key.
$this->app['options']->remove('key'); // Delete an option by key.
$this->app['options']->all(); // Get all autoload options.
$this->app['options']->toArray(); // Same all().
$this->app['options']->toJSon(); // Same all() but json format.
$this->app['options']['key'] // Array access: offsetGet
$this->app['options']['key'] = 'value' // Array access: offsetSet.
isset($this->app['options']['key']) // Array access: offsetExists.
unset($this->app['options']['key']) // Array access: offsetUnset.
```

### Configuration

[](#configuration)

```
# Enable autoload options only.
OPTIONS_ONLY_AUTOLOAD=true

# Eager load options.
OPTIONS_EAGER_LOAD=true

# Custom model
OPTIONS_MODEL=App\Models\Option
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Dinh Quoc Han](https://github.com/dinhquochan)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~38 days

Total

11

Last Release

1013d ago

Major Versions

v0.1.2 → v1.0.02023-01-10

v1.0.1 → v2.0.02023-02-15

PHP version history (2 changes)v0.1.0PHP ^8.0|^8.1

v1.0.0PHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/03c4e5a3dbdbd2e2c83daba8b38e2cb15cab2d0bcce1395ce48d326d1406df82?d=identicon)[dinhquochan](/maintainers/dinhquochan)

---

Top Contributors

[![dinhquochan](https://avatars.githubusercontent.com/u/9979458?v=4)](https://github.com/dinhquochan "dinhquochan (33 commits)")[![datlechin](https://avatars.githubusercontent.com/u/56961917?v=4)](https://github.com/datlechin "datlechin (1 commits)")

---

Tags

laravellaravel-packagephplaravel-optionsqh-8

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/qh-8-laravel-options/health.svg)

```
[![Health](https://phpackages.com/badges/qh-8-laravel-options/health.svg)](https://phpackages.com/packages/qh-8-laravel-options)
```

###  Alternatives

[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[naoray/eloquent-model-analyzer

Helpful methods to gain more information about eloquent model classes.

16431.1k1](/packages/naoray-eloquent-model-analyzer)[overtrue/laravel-options

Global options module for Laravel application.

5218.5k3](/packages/overtrue-laravel-options)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)

PHPackages © 2026

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