[5.x] Ability to set custom Glide hash #9918
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alternate solution to #9781.
This PR lets you customer the unique hash in Glide-generated files.
By default, the hash is just literally just a md5 hash of the manipulation parameters.
You may want to customize it to make it more human readable for debugging or QA purposes as explained in #9781 or just because you prefer it aesthetically.
You can do this in your AppServiceProvider:
When generating a glide image like this:
normally it would be generated to a path like this:
but with the custom closure it would get generated to this:
This PR also just does some minor cleanup and refactoring of the cachePath method.