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

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

xuejd3/laravel-options
======================

Global options loaded from the database

13.0.0(3mo ago)03↓91.7%MITPHPPHP ^8.3

Since Mar 17Pushed 3mo agoCompare

[ Source](https://github.com/xuejd3/laravel-options)[ Packagist](https://packagist.org/packages/xuejd3/laravel-options)[ Docs](https://github.com/appstract/laravel-options)[ RSS](/packages/xuejd3-laravel-options/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (32)Used By (0)

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

[](#laravel-options)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9955253679128f5a4abd3dee1a5a16fe06a2f6d0d997c5ec36f9d863deb05c58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6170707374726163742f6c61726176656c2d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-options)[![Total Downloads](https://camo.githubusercontent.com/1e19b1ec7f272c99ca09838434c2c85fe513c267703851962c0848e5440c012f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6170707374726163742f6c61726176656c2d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-options)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Global key-value store in the database

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

[](#installation)

To get started with laravel-options, use Composer to add the package to your project's dependencies:

```
composer require appstract/laravel-options
```

### Publish, migrate

[](#publish-migrate)

By running `php artisan vendor:publish --provider="Appstract\Options\OptionsServiceProvider"` in your project all files for this package will be published. For this package, it's only a migration. Run `php artisan migrate` to migrate the table. There will now be an `options` table in your database.

Usage
-----

[](#usage)

With the `option()` helper, we can get and set options:

```
// Get option
option('someKey');

// Get option, with a default fallback value if the key doesn't exist
option('someKey', 'Some default value if the key is not found');

// Set option
option(['someKey' => 'someValue']);

// Remove option
option()->remove('someKey');

// Check the option exists
option_exists('someKey');
```

If you want to check if an option exists, you can use the facade:

```
use Option;

$check = Option::exists('someKey');
```

The helpers are available as Blade directives:

```
@option('someKey')

@option('someKey', 'Default value')

@optionExists('someKey')
    // Code
@endif
```

### Console

[](#console)

It is also possible to set options within the console:

```
php artisan option:set {someKey} {someValue}
```

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Contributions are welcome, [thanks to y'all](https://github.com/appstract/laravel-options/graphs/contributors) :)

About Appstract
---------------

[](#about-appstract)

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/teamappstract), [buy us a beer](https://www.paypal.me/teamappstract/10) or [support us on Patreon](https://www.patreon.com/appstract).

License
-------

[](#license)

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

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.7% 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 ~113 days

Recently: every ~252 days

Total

30

Last Release

94d ago

Major Versions

4.1.0 → 5.1.02020-03-26

4.1.1 → 5.2.02020-09-08

5.7.0 → 6.0.02024-06-03

6.0.0 → 7.0.02025-04-03

7.0.0 → 13.0.02026-03-25

PHP version history (4 changes)0.1.0PHP &gt;=5.6

4.0.0PHP &gt;=7.2.5

7.0.0PHP &gt;=8.3

13.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4f561805939698fed46bd2240ab99f626e8b1691560ba645617909760d09b60?d=identicon)[xuejd3](/maintainers/xuejd3)

---

Top Contributors

[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (74 commits)")[![apiaget](https://avatars.githubusercontent.com/u/634083?v=4)](https://github.com/apiaget "apiaget (7 commits)")[![realrashid](https://avatars.githubusercontent.com/u/15607685?v=4)](https://github.com/realrashid "realrashid (6 commits)")[![MarkVaughn](https://avatars.githubusercontent.com/u/39970?v=4)](https://github.com/MarkVaughn "MarkVaughn (6 commits)")[![jerodev](https://avatars.githubusercontent.com/u/3493941?v=4)](https://github.com/jerodev "jerodev (5 commits)")[![teuunn](https://avatars.githubusercontent.com/u/17406280?v=4)](https://github.com/teuunn "teuunn (3 commits)")[![christophheich](https://avatars.githubusercontent.com/u/16765979?v=4)](https://github.com/christophheich "christophheich (3 commits)")[![ovanschie](https://avatars.githubusercontent.com/u/3015449?v=4)](https://github.com/ovanschie "ovanschie (2 commits)")[![uniconstructor](https://avatars.githubusercontent.com/u/1384545?v=4)](https://github.com/uniconstructor "uniconstructor (2 commits)")[![SpitsAdmin](https://avatars.githubusercontent.com/u/16835345?v=4)](https://github.com/SpitsAdmin "SpitsAdmin (2 commits)")[![xuejd3](https://avatars.githubusercontent.com/u/16837278?v=4)](https://github.com/xuejd3 "xuejd3 (1 commits)")[![adriangonzales](https://avatars.githubusercontent.com/u/486071?v=4)](https://github.com/adriangonzales "adriangonzales (1 commits)")[![yaroslawww](https://avatars.githubusercontent.com/u/23663794?v=4)](https://github.com/yaroslawww "yaroslawww (1 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (1 commits)")[![armandsar](https://avatars.githubusercontent.com/u/3834314?v=4)](https://github.com/armandsar "armandsar (1 commits)")[![cjonstrup](https://avatars.githubusercontent.com/u/576584?v=4)](https://github.com/cjonstrup "cjonstrup (1 commits)")[![crivion](https://avatars.githubusercontent.com/u/15253384?v=4)](https://github.com/crivion "crivion (1 commits)")[![jornatf](https://avatars.githubusercontent.com/u/92311176?v=4)](https://github.com/jornatf "jornatf (1 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![meSingh](https://avatars.githubusercontent.com/u/2369397?v=4)](https://github.com/meSingh "meSingh (1 commits)")

---

Tags

appstractlaravel-options

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[wearepixel/laravel-cart

A cart implementation for Laravel

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

PHPackages © 2026

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