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

[8.x] Implement supportsTags() on the Cache Repository #34820

Merged
merged 3 commits into from
Oct 13, 2020

Conversation

mathiasonea
Copy link
Contributor

This small enhancement would be a benefit to all those users using something like Redis in their production environment, but can't setup locally any redis or other taggable Cache Store. Currently, if your cache driver does not support tags (e.g. locally, you would have to wrap the tags() call in a try catch block. In my opinion that is quite verbose.

In order to find out more elegantly if the currently chosen cache store supports tags, a new method supportsTags() is proposed on the Cache Repository. With this method, they can execute the "tagging" part of the cache logic only if their chosen cache store supports that feature.

It does not affect any other caching behaviour, neither does it touch any other aspect of the framework itself, so this should be a safe one.

… more elegantly if the currently chosen cache store is taggable.
@mathiasonea mathiasonea changed the title Implement supportsTags() on the Cache Repository [8.x] Implement supportsTags() on the Cache Repository Oct 13, 2020
@taylorotwell taylorotwell merged commit d004392 into laravel:8.x Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants