Skip to content

[13.x] Add enum types to repository contract / allow enums for tagged caches#58481

Merged
taylorotwell merged 5 commits intolaravel:masterfrom
jackbayliss:13.x-add-enum-types-to-repo-interface
Jan 24, 2026
Merged

[13.x] Add enum types to repository contract / allow enums for tagged caches#58481
taylorotwell merged 5 commits intolaravel:masterfrom
jackbayliss:13.x-add-enum-types-to-repo-interface

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Jan 24, 2026

12.x hasadded enum support for all the repository methods. For 13.x I thought it's good practice to keep the contract updated.

Then, I noticed there's tag caches, that probably should allow enums too.. as some methods don't fallback to the Repository (they override them).

So this PR:

  • Adds enum types to the Repository contract
  • Ensures TaggedCache / RedisTaggedCache also allow enums for any methods they override.

This means:

  • The contract is up to date
  • Tags work with enums too.
// This now allows enums too...
Cache::tags(['people', 'authors'])->put(Test::FOO);
Cache::tags(['people', 'authors'])->get(Test::FOO);

I added tests for the TaggedCache, can't see anything for the Redis one.

Targeted 13.x as interface changes..

@github-actions
Copy link

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
Copy link
Contributor Author

Static analysis is failing cause master needs to be caught up - but good for review, thanks!

@jackbayliss jackbayliss marked this pull request as ready for review January 24, 2026 13:48
@taylorotwell taylorotwell merged commit 39343c7 into laravel:master Jan 24, 2026
63 of 64 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