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

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

soandso/laravel-options
=======================

Laravel service for global storing key-value structure data

0.2.0(4y ago)010MITPHPPHP ^8.0

Since Mar 21Pushed 4y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

[![GitHub](https://camo.githubusercontent.com/79bee46a8d67563b3f286fd6515d71793b20ae35771be4c27b6dc6edc389c76b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/79bee46a8d67563b3f286fd6515d71793b20ae35771be4c27b6dc6edc389c76b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)[![GitHub Workflow Status (event)](https://camo.githubusercontent.com/1d785c393eae541460bc1a72128832cda05d019c978b05dc2271089cbf4b24a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e732f504850253230436f6d706f736572)](https://camo.githubusercontent.com/1d785c393eae541460bc1a72128832cda05d019c978b05dc2271089cbf4b24a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e732f504850253230436f6d706f736572)[![GitHub top language](https://camo.githubusercontent.com/ac6c7320a8ec702403240498021c051bccd72e4ce840df3820efb3e1d05c45f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/ac6c7320a8ec702403240498021c051bccd72e4ce840df3820efb3e1d05c45f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)[![GitHub release (latest by date)](https://camo.githubusercontent.com/eef9a6bda59d96c7dab21405b9f26a6391bb9d6cec20ba63b04a22684e40be80/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/eef9a6bda59d96c7dab21405b9f26a6391bb9d6cec20ba63b04a22684e40be80/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)[![Packagist PHP Version Support](https://camo.githubusercontent.com/77115cf62518b061920393c9dbe4be244942c2b4bb41584154600201fccefffd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f616e64736f2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/77115cf62518b061920393c9dbe4be244942c2b4bb41584154600201fccefffd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f616e64736f2f6c61726176656c2d6f7074696f6e73)[![GitHub code size in bytes](https://camo.githubusercontent.com/75b42f7af51ee9d082aa6226b0723e8d8e045cb2ace7aa9d827b34cf1c722acd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/75b42f7af51ee9d082aa6226b0723e8d8e045cb2ace7aa9d827b34cf1c722acd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)[![GitHub Release Date](https://camo.githubusercontent.com/c6d97f794e60e0849fda4589f3da4149831daa71f25ebc008b312eb24861ce96/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)](https://camo.githubusercontent.com/c6d97f794e60e0849fda4589f3da4149831daa71f25ebc008b312eb24861ce96/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f736f616e64736f5377456e2f6c61726176656c2d6f7074696f6e73)[![Codacy coverage](https://camo.githubusercontent.com/fe70e14f15e0dd3a5bebef3ba3ab712aa89a1d015c71f91bcee774480523b12d/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f636f7665726167652f3463663636313565386437363434326361653633366364623432663264303962)](https://camo.githubusercontent.com/fe70e14f15e0dd3a5bebef3ba3ab712aa89a1d015c71f91bcee774480523b12d/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f636f7665726167652f3463663636313565386437363434326361653633366364623432663264303962)

Laravel options
===============

[](#laravel-options)

Laravel service for global storing in database key-value structure data

Requirements
------------

[](#requirements)

This library only requires PHP &gt;= 8.0

Setup
-----

[](#setup)

Add the library to your composer.json file in your project:

```
{
  "require": {
      "soandso/laravel-options": "0.*"
  }
}
```

Use [composer](http://getcomposer.org) to install the library:

```
$ php composer.phar install
```

You can also use composer on the command line to require and install Grouping:

```
$ php composer.phar require soandso/laravel-options
```

You should publish the migration with `php artisan vendor:publish --provider="Soandso\LaravelOptions\OptionProvider" `

Run `php artisan migrate` to migrate the table.

Usage
-----

[](#usage)

### Facade

[](#facade)

Set parameter value:

The parameter key must be unique to the Option entity Formats available for the parameter value - string, array

```
use Soandso\LaravelOptions\Option;

Option::set($key, $value);
```

The method returns `true` in case of successful setting of the parameter value or `false` in case of an error

Get parameter value:

```
Option::get($key);
```

If there is no parameter for the specified key, the method will return `false`

Check if the parameter with the given key exists

```
Option::exists($key);
```

Returns `true` or `false` depending on the result

Delete a parameter by its key

```
Option::destroyByKey($key);
```

Returns `true` if deletion was successful, `false` if deletion failed.

### Helper function

[](#helper-function)

With helper `setOption()` you can set options

```
setOption($key, $value)
```

helper `getOption()` will return the value of the option by its key

```
getOption($key)
```

Helper function `existsOption()` checks if the parameter with the given key exists

```
existsOption($key)
```

Function `destroyOption` deletes a parameter by its key

```
destroyOption($key)
```

### Console

[](#console)

The command to delete parameters is available in the console.

```
 php artisan option:clear
```

This command will delete all data. You can restrict deletion by the date of creation or last update of the parameter

```
 php artisan option:clear
```

Date must be in `Y-m-d` format. In this case, all parameters that are older than the specified date will be deleted.

License
-------

[](#license)

Laravel option is licensed under the MIT License ().

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

3

Last Release

1507d ago

### Community

Maintainers

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

---

Top Contributors

[![soandsoSwEn](https://avatars.githubusercontent.com/u/18630322?v=4)](https://github.com/soandsoSwEn "soandsoSwEn (58 commits)")

---

Tags

optionstore option

### Embed Badge

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

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

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k541.2M158](/packages/phpoption-phpoption)[kartik-v/dependent-dropdown

A multi level dependent dropdown JQuery plugin that allows nested dependencies.

1805.0M3](/packages/kartik-v-dependent-dropdown)[fof/nightmode

Add a Night Mode option for your users to use on your Flarum forum

3774.5k2](/packages/fof-nightmode)[chippyash/monad

Functional programming Monad support

2828.1k8](/packages/chippyash-monad)

PHPackages © 2026

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