Skip to content

Comments

[12.x] Enum support for Cache::get() with array keys#58616

Merged
taylorotwell merged 1 commit intolaravel:12.xfrom
jackbayliss:12.x-getMany-enums
Feb 4, 2026
Merged

[12.x] Enum support for Cache::get() with array keys#58616
taylorotwell merged 1 commit intolaravel:12.xfrom
jackbayliss:12.x-getMany-enums

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Feb 4, 2026

This works:

Cache::get(CacheKey::Users)

This doesn't:

Cache::get([CacheKey::Users, CacheKey::Posts]) 
Cache::getMultiple([CacheKey::Users, CacheKey::Posts])

Someone on my team (@MizouziE) tried this and it didn't work, so thought I'd try a PR.. not sure on your opinion (I know you're sick of these), but felt like it keeps the API consistent, but probably will open a can of worms on array usages...

If you want me to go through all of the array ones, let me know.. (ie put etc also support arrays) but thought i'd try just these for now to get the ball rolling - but totally understand if you don't fancy it!

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

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 jackbayliss marked this pull request as ready for review February 4, 2026 12:47
@taylorotwell taylorotwell merged commit 0f3caf7 into laravel:12.x Feb 4, 2026
72 checks passed
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