New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

orchid/settings

Settings this is key-value storage
29,271 11
Install
composer require orchid/settings
Latest Version:5.0.0
PHP:^8.0
Laravel:9
Older releases:5 · 7 · 8
License:MIT
Last Updated:May 30, 2023
Links: GitHub  ·  Packagist
Maintainer: Mamau

Laravel Settings

Unit tests Latest Stable Version Total Downloads License

The simplest persistent data store using a key to access a value.

Installation

Run this at the command line:

$ composer require orchid/settings

After do the migration:

$ php artisan migrate

Usage

To add a new value to the repository you need to use:

<?php

use Orchid\Settings\Setting;

Setting::set($key, $value);

The transferred value will be converted to JSON, and upon receipt, decoding will occur, this allows you to place not only simple types, but also arrays in the storage.

To get the value:

<?php

/**
* @param string|array $key
* @param string|null $default
*/
Setting::get($key, $default);
// or using the helper function
setting($key, $default);

By default, each item cached before it is changed, in cases if you need to get a value not from the cache, you need to use the getNoCache method.

Setting::getNoCache($key, $default = null);

Note. When transferring keys as an array, subsequent updates of values will not automatically flush the cache.

To delete a value:

<?php

/**
* @param string|array $key
* @param string|null $default
*/
Setting::forget($key);

Please note that you can get or delete several values from the repository at once, for this you need to pass an array with the names of the keys as the first argument.

License

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

Related Packages

hackeresq/laravel-settings

Super simple key/value settings for Laravel 8+

2,195 31
rennokki/eloquent-settings

Eloquent Settings allows you to bind key-value pairs to any Laravel Eloquent mod...

4,232 80
arcanedev/laravel-settings

This package allows you to persists configs/settings for Laravel projects.

147,246 73
karlmonson/tenant

Tenant allows for storing configuration settings in the database. This package i...

14 28
ybr-nx/laravel-mariadb

Add MariaDB JSON select support to Laravel

481,516 96

Version History

Version Released PHP Laravel License
5.0.0 ^8.0 ^9.0 MIT
4.0 >=7.3 ~8.0 MIT
3.0 >=7.2 ~7.0 MIT
2.2.1 >=7.0 ~5.4 MIT
2.2 >=7.0 >=5.4 MIT