PHPackages                             combindma/laravel-option - 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. [Database &amp; ORM](/categories/database)
4. /
5. combindma/laravel-option

ActiveLibrary[Database &amp; ORM](/categories/database)

combindma/laravel-option
========================

A key-value storage for laravel

0.2.0(1mo ago)0214MITPHPPHP ^8.3

Since Jul 29Pushed 1mo agoCompare

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

READMEChangelog (3)Dependencies (26)Versions (4)Used By (0)

A key-value storage for laravel
===============================

[](#a-key-value-storage-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/238086d2cb52bbe4128ccdb303cffa20fa5828d4091b939bb40e58988325a23d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6d62696e646d612f6c61726176656c2d6f7074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/combindma/laravel-option)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c04b5cfd32b430611dd7fba88552fe8b5dbda712c8d3516b61d5cafd0d0f5765/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d62696e646d612f6c61726176656c2d6f7074696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/combindma/laravel-option/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5600143940f57dc5bc7187dd1a115f1e3aaddb3d0a75836e13d3bf6fc3c79f77/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d62696e646d612f6c61726176656c2d6f7074696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/combindma/laravel-option/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/77a8155851587b44edbc928ca36373761cc9074fa5e770176dcc80abfcdbabeb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6d62696e646d612f6c61726176656c2d6f7074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/combindma/laravel-option)

This package uses [spatie valuestore](https://github.com/spatie/valuestore) under the hood.

About Combind Agency
--------------------

[](#about-combind-agency)

[Combine Agency](https://combind.ma?utm_source=github&utm_medium=banner&utm_campaign=package_name) is a leading web development agency specializing in building innovative and high-performance web applications using modern technologies. Our experienced team of developers, designers, and project managers is dedicated to providing top-notch services tailored to the unique needs of our clients.

If you need assistance with your next project or would like to discuss a custom solution, please feel free to [contact us](mailto:hello@combind.ma) or visit our [website](https://combind.ma?utm_source=github&utm_medium=banner&utm_campaign=package_name) for more information about our services. Let's build something amazing together!

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

[](#installation)

You can install the package via composer:

```
composer require combindma/laravel-option
```

You can publish the config file with:

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

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Default disk
    |--------------------------------------------------------------------------
    |
    | This is the default disk that will be used to store the options file.
    |
    */

    'disk' => 'local',
    /*
    |--------------------------------------------------------------------------
    | Default filename
    |--------------------------------------------------------------------------
    |
    | This is the default filename for the options file.
    |
    */

    'filename' => 'options.json',
];
```

Usage
-----

[](#usage)

This package makes it easy to store and retrieve some loose values. Stored values are saved as a json file.

It can be used like this:

```
option()->put('key', 'value');

option()->get('key'); // Returns 'value'

option()->has('key'); // Returns true

// Specify a default value for when the specified key does not exist
option()->get('non existing key', 'default') // Returns 'default'

option()->put('anotherKey', 'anotherValue');

// Put multiple items in one go
option()->put(['ringo' => 'drums', 'paul' => 'bass']);

option()->all(); // Returns an array with all items

option()->forget('key'); // Removes the item

option()->flush(); // Empty the entire options

option()->flushStartingWith('somekey'); // remove all items whose keys start with "somekey"

option()->increment('number'); // option()->get('number') will return 1
option()->increment('number'); // option()->get('number') will return 2
option()->increment('number', 3); // option()->get('number') will return 5

// Option implements ArrayAccess
option()['key'] = 'value';
option()['key']; // Returns 'value'
isset(option()['key']); // Return true
unset(option()['key']); // Equivalent to removing the value
```

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)

- [Combind](https://github.com/combindma)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

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

Total

3

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31b418bcbabafab33631fd151a64d3e18035f728ad195814aa4656d862610fcd?d=identicon)[combindma](/maintainers/combindma)

---

Top Contributors

[![omarherri](https://avatars.githubusercontent.com/u/12627384?v=4)](https://github.com/omarherri "omarherri (2 commits)")

---

Tags

laravelcombindmalaravel-option

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/combindma-laravel-option/health.svg)

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

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

203330.1k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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