Skip to content
Global key-value store in the database
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
database/migrations Add unique constraint to `key` field in database Feb 13, 2019
src Small change/revert Feb 15, 2019
tests Change test docblock Feb 17, 2019
.styleci.yml StyleCI linting Jan 15, 2019
composer.json orchestra update Feb 17, 2019

Laravel Options

Latest Version on Packagist Total Downloads Software License Build Status

Global key-value store in the database


You can install the package via composer:

composer require appstract/laravel-options

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.


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

// Get option

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

// Check the option exists

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

use Option;

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

Setting a value to a key that already exists will overwrite the value.


It is also possible to set options within the console:

php artisan option:set {someKey} {someValue}


$ composer test


Contributions are welcome, thanks to y'all :)

About Appstract

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.


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

You can’t perform that action at this time.