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 (defaultc-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.
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