NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #3698 most downloaded on Packagist
Model Settings for your Laravel app
Last release 1 months ago
02 Sep 2026
Release timing varies
gaps range from 2 weeks to 12 months
Nearly every release is documented
notes for 46 of 51 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
51 releases · first in 2019
9.1.0 adds a fourth storage backend: a generic cache driver that stores settings through Laravel's Cache facade, so any store configured in config/cac
9.1.0 adds a fourth storage backend: a generic cache driver that stores settings through Laravel's Cache facade, so any store configured in config/cache.php can back them.
✨ New: the cache driver
Set MODEL_SETTINGS_DRIVER=cache, or protected $settingsDriver = 'cache'; on a single model, to store settings in Memcached, DynamoDB, the database, files, or any other store from config/cache.php.
MODEL_SETTINGS_CACHE_STORE — named store, empty = the application defaultMODEL_SETTINGS_CACHE_TTL — lifetime in minutes, empty = foreverMODEL_SETTINGS_CACHE_PREFIX — storage key prefix (default c-k-)Settings are stored forever by default, because for this driver the cache is the only copy of the data rather than a layer in front of a database. The lifetime is refreshed only on write, never on read, so an expiring value will disappear even from a model whose settings are read constantly. A 0, negative or non-numeric TTL throws ModelSettingsException instead of being passed to Cache::put(), which would treat it as a delete.
⚠️ Two things to weigh before choosing this driver: anything that flushes the store (php artisan cache:clear, Cache::flush()) erases the settings of every model using it, and stores that evict under memory pressure can drop them at any time. Use the field or table driver if the settings must survive that.
🔄 Behavior change
The table, redis and cache drivers now require the model to exist in storage, not merely to have a primary key assigned. ModelSettingsException is thrown for an unsaved model even when its key was set manually, so code that used (new User(['id' => 5]))->settings()->all() as a lightweight reference read must load the model instead.
📝 Also documented in this release: the CHANGELOG now carries the previously missing 9.0.1 and 9.0.2 entries.
Full changelog: 9.0.2...9.1.0
One column per quarter.
cache driver (CacheSettingsManager) storing settings through Laravel's Cache facade, so any store configured in config/cache.php (Memcached, DynamoDB, database, file, ...) can back themdrivers.cache.store (named store, empty = default), drivers.cache.ttl (lifetime in minutes, empty = forever) and drivers.cache.key_prefix, driven by MODEL_SETTINGS_CACHE_STORE, MODEL_SETTINGS_CACHE_TTL and MODEL_SETTINGS_CACHE_PREFIXcache driver stores settings forever unless a TTL is configured, because for this driver the cache is the only copy of the data; a non-positive or non-numeric ttl throws ModelSettingsException instead of being passed to Cache::put(), which would treat it as a deletetable, redis and cache drivers now require the model to exist in storage rather than merely to have a primary key assigned: ModelSettingsException is thrown for an unsaved model even when its key was set manually (refines the 9.0.0 behavior below)Reading a missing key with the redis driver no longer emits a deprecation notice
FieldSettingsManager::castsToNativeArray() - a public static helper that recognises the array, json, object and collection casts plus the AsArrayObject, AsCollection, AsEnumArrayObject and AsEnumCollection cast classes; both the field driver and fixSettingsValue() resolve casts through itfield driver reads Arrayable column values (AsCollection, AsArrayObject, ...) and stdClass values (the object cast), not only arrays and JSON strings$persistSettings property; isPersistSettings() now resolves setPersistSettings() override, then the model property, then the drivers.<driver>.persistent config. The trait's internal flag was renamed to $persistSettingsOverride so a model is free to declare $persistSettings without a trait-property conflictfield driver throws ModelSettingsException when the settings column was not selected on an existing model instance (a partial select()) instead of silently reading and writing empty settingsredis driver no longer emits a deprecation noticegetSettingsCacheKey(), cacheKey() and the field driver's schema-check cache key now include the connection name (and the field name, for the schema check), so same-named tables or fields on different database connections no longer share a cached entryFull Changelog : 9.0.0...9.0.1
Full Changelog: 9.0.0...9.0.1
field driver honours an Eloquent array, json, object or collection cast on the settings column: the value is handed to the cast as an array instead of being double-encoded to a JSON string, and an already-decoded array is read back as-isfixSettingsValue() (the saving hook) skips its own json_encode for a cast column, so the cast is no longer applied on top of an encoded string🔄 Breaking Changes Migration Required — see MIGRATION_GUIDE_8_to_9.md
V9 is a major refactor that unifies the storage backends into a single, configuration-driven system. This release simplifies the API surface, reduces boilerplate, and provides better extensibility for custom drivers.
🔄 Breaking Changes
Migration Required — see MIGRATION_GUIDE_8_to_9.md
Removed HasSettingsField, HasSettingsTable, HasSettingsRedis traits
Removed flat settings_* config keys (env vars unchanged)
Requires PHP 8.2+ and Laravel 12–13 (dropped 10/11, PHP 8.1)
Mutations (set, update, delete, etc.) now persist only overrides; defaults are no longer copied into storage
Validation runs against the effective (merged) result, not just persisted data
table and redis drivers throw ModelSettingsException when model has no primary key
Redis driver deletes the storage key on clear() instead of storing empty array
HasSettings trait with configuration-driven driver selection (MODEL_SETTINGS_DRIVER env / driver config / per-model $settingsDriver property)SettingsManagerFactory singleton with extend() for registering custom drivers at runtimedrivers.<name>.*drivers.redis.connection (named connection) and drivers.redis.key_prefixHasSettingsField, HasSettingsTable and HasSettingsRedis traits - see MIGRATION_GUIDE_8_to_9.mdsettings_* config keys (env variable names are unchanged)set, update, delete, setMultiple, deleteMultiple) persist only the stored overrides - defaults are no longer copied into storage; validation runs against the effective (default-merged) resulttable and redis drivers throw ModelSettingsException when the model has no primary key yetredis driver deletes the storage key when settings are cleared instead of storing an empty arrayLaravel 13.x Compatibility by @laravel-shift in #134
Full Changelog: 8.0.3...8.0.4
Removed Model::getConnectionName() override and moved fallback to eac…
Removed Model::getConnectionName() override and moved fallback to eac…
…h call. (#122)
fix: nullable type parameter deprecation on PHP 8.4
[Proposal] Rename HasSettings::getRules to HasSettings::getSettingsRules by @ipswise in #123
Laravel 12.x Compatibility by @laravel-shift in #126
Apply fixes from StyleCI by @glorand in #113
Full Changelog: 6.0.3...7.0.0
Fix "Segmentation fault" for model inheritance
Fix "Segmentation fault" for model inheritance (#109)
* Fix "Segmentation fault" for model inheritance
* Fix formatting
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for Laravel 9 by @belzaaron
### Fix - fix validation variable name
Validation system for settings data
Using another method name other than settings()
### Fix param type
### Added - PHP8 support
Refactor the work with default settings (flatten arrays)
### Added - Refactor unit tests
Setup connection of the model in HasSettingsTableTrait
### Added - Update README
Drop support for Laravel 5.8 and lower
HasSettingsField now adheres to $connection override on model Ref. task
### Fix - code refactor
default configs for a table in model_settings.php config file
use Cache facade instead of cache() helper function
### Fix - github actions
"empty()" - to check if the model has empty setting
"exist()" - to check if the model has valid setting
https://github.com/glorand/laravel-model-settings/issues/50
- add support for Laravel 7
### Bugfix
https://github.com/glorand/laravel-model-settings/issues/40
https://github.com/glorand/laravel-model-settings/issues/36
https://github.com/glorand/laravel-model-settings/issues/33
Check column settings exists directly on the database table
Use cache in case of Table Settings Ref. task
### Added - Manage array type settings
### Added - Redis support
Nothing published for this version
### Added - Default settings on Model
Compatibility with PSR-16, CacheInterface
### Added - Test for console commands
Configure persistence for settings in case of Field Type (HasSettingsField)
Nothing published for this version
Command to create the table for settings
### Added - Console Commands
### Added - Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →