Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch/Flush All Settings #32

Merged
merged 4 commits into from
Sep 28, 2023
Merged

Fetch/Flush All Settings #32

merged 4 commits into from
Sep 28, 2023

Conversation

rawilk
Copy link
Owner

@rawilk rawilk commented Sep 28, 2023

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

@rawilk rawilk added enhancement New feature or request breaking change PR introduces breaking changes labels Sep 28, 2023
@rawilk
Copy link
Owner Author

rawilk commented Sep 28, 2023

Multiple settings can be deleted at once using the flush() method on the settings facade. This will work very similar to how all works.

@rawilk rawilk merged commit 49a222c into v3.x Sep 28, 2023
8 checks passed
@rawilk rawilk deleted the feature/fetch-all branch September 28, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change PR introduces breaking changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant