ValueStore is a database-backed key-value store for settings and configuration that cannot be defined in static config files. It works reliably in cloud environments where filesystem access is limited.
Usage
// Store
ValueStore::put('key', 'value');
ValueStore::put('preferences', ['theme' => 'dark', 'language' => 'en']);
// Retrieve
$value = ValueStore::get('key', 'default');
// Check existence
$exists = ValueStore::exists('key'); // true or false
// Remove
ValueStore::forget('key');
The value column uses JSON casting, so you can store strings, numbers, booleans, arrays, and objects.
put() and set() are aliases — both store a value under the given key.