An issue was brought up in issue #39 where it can be confusing that the default value passed into settings()->get() is cached and not documented - see https://github.com/rawilk/laravel-settings/issues/39#issuecomment-1747228762. This PR adds a cache_default_value configuration option. When set to false, the package will not cache the value of the default value passed in. The following code will work as expected with this new configuration option set to false.
$language = settings()->get('site.lang', 'en'); // 'en'
// some other code
// `site.lang` is still not persisted at this point, so the
// default value we provide the function should be the value returned.
$language = settings()->get('site.lang', 'es'); // 'es'
This configuration option will be set to true by default, however in future major versions, it may default to false.
An issue was brought up in issue #39 where it can be confusing that the default value passed into
settings()->get()
is cached and not documented - see https://github.com/rawilk/laravel-settings/issues/39#issuecomment-1747228762. This PR adds acache_default_value
configuration option. When set tofalse
, the package will not cache the value of the default value passed in. The following code will work as expected with this new configuration option set to false.This configuration option will be set to
true
by default, however in future major versions, it may default tofalse
.