bgaze/laravel-kvstore
bgaze/laravel-kvstore provides a simple, database-backed key-value store for Laravel applications. Store and retrieve arbitrary values—strings, arrays, objects—through an intuitive API with dot-notation support, caching, and easy integration for app settings, preferences, and small configuration dat...
settings table.array, json, object, collection) or be serialised by the caller. That supports product decisions to let non-engineers write structured settings through admin tooling without risking silent JSON-string corruption.Consider adoption when:
KvStore::set('features', ['beta' => true]) now throws InvalidArgumentException instead of storing '["a"]' on update or failing with Array to string conversion on insert). For product data, silent degradation is worse than a loud failure.Look elsewhere when:
New adopters should treat v2.3.0 as the baseline: the strictness is a feature, and the test suite now pins accepted scalar types (strings, numbers, booleans, null, DateTimeInterface, __toString objects including Collection) so the guard should not quietly narrow later.
For executives: This is a small, low-risk Laravel package for storing product settings and feature flags in the database. The new release (v2.3.0) fixes a silent data-corruption path: previously, writing an array without the right cast could either crash on insert or silently store a raw JSON string on update, indistinguishable from an intentionally stored value. It now fails fast with a clear error naming the type and the cast that fixes it. That is a maturity improvement, not a feature expansion. The practical cost is a short engineering audit of any code that writes arrays, objects, or enums to the store; the practical benefit is fewer “why did this setting turn into a string?” incidents.
For engineering: v2.3.0 makes set() reject values that a text column cannot accept as-is unless a serialising cast is present. set('features', ['beta' => true]) and set('features', ['beta' => true], 'integer') both throw InvalidArgumentException; set('features', ['beta' => true], 'array') succeeds. Scalars, null, DateTimeInterface, and __toString objects (including Collection) remain unaffected. There are no schema changes and no other API changes. Upgrade path: grep for KvStore::set( calls passing arrays, plain objects, or enums without array/json/object/collection, and either add the cast or serialise before writing. This is a minor because a documented limitation now raises; it is not a supported-behaviour break.
How can I help you explore Laravel packages today?