All settings can be fetched at once using all() on the Settings facade. If an array of setting keys are passed in to all, only those specific keys will be fetched. If a context object is supplied (via settings()->context(...), only settings applicable to that context are fetched. A false value may also be supplied for the context, which will only return settings that don't have a context applied to it.
As a note, fetching settings via all() does not use the cache at all. As of right now, I'm not sure of a good way to generate a cache key for multiple settings and even if there was a way, I'm not sure of a good way to bust the cache for those grouped settings when a single setting is updated or deleted using set() and forget().
PR adds ability to fetch and flush all settings.
All settings can be fetched at once using
all()
on the Settings facade. If an array of setting keys are passed in to all, only those specific keys will be fetched. If a context object is supplied (viasettings()->context(...)
, only settings applicable to that context are fetched. Afalse
value may also be supplied for the context, which will only return settings that don't have a context applied to it.As a note, fetching settings via
all()
does not use the cache at all. As of right now, I'm not sure of a good way to generate a cache key for multiple settings and even if there was a way, I'm not sure of a good way to bust the cache for those grouped settings when a single setting is updated or deleted usingset()
andforget()
.