Repository navigation
[14.x] Ensure Cache has & forget work for arrays - #61466
Merged
taylorotwell merged 4 commits intoSep 7, 2026
Merged
Conversation
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
jackbayliss
marked this pull request as ready for review
September 7, 2026 13:04
binaryfire
added a commit
to hypervel/components
that referenced
this pull request
Sep 28, 2026
Resolve associative, mixed and sparse input into the same key list used by many(), without carrying default values into the existence check. Keep repository events, enum handling, wrapper stores and cached-null semantics. Extend the existing array-key test to cover defaults, false values and cached nulls alongside sparse and mixed keys. Follow-up to laravel/framework#61466. Validated CacheRepositoryTest, the affected parallel test selection, source and type analysis, and formatting.
binaryfire
added a commit
to hypervel/components-backup
that referenced
this pull request
Oct 1, 2026
Check every requested key in has and delegate array removal to deleteMultiple. Keep enum-key normalization and existing tagged-cache restrictions, widen the repository contract consistently, and update generated facade annotations, tests and documentation. Upstream: laravel/framework#61466 Framework source: 7068848dfe48fc3a433598e09ce798799d442a52. Documentation source: laravel/docs 13.x at ec28ad6ee78ebeada6095e05d33da7e8c42dd6dc. Validated with affected tests, repository formatting, full source and type-fixture analysis, and the full parallel test suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This surprised me as has / forget report that it works for arrays:
But, if you do
Cache::has(['some', 'thing'])even if it doesnt exist, it'll always return true, for anything.Similar for forget, if you give it an array it won't actually forget the array.
This PR ensures they work as expected, ie forget with an array will forget them all.. and has ensures all the items exist. The same as get() and put() do basically.
Its been like it in the docblocks for 4 years since 732a29a so, I didn't go with pulling array out, as people may still use it.
Let me know if you would rather me pull the array doc or, whatever you see best! 🫡
I've targeted 14.x as folk may not realise this.. and dont fancy breaking apps