Skip to content

[13.x] Add enum support to contextual attribute binding#60092

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
Tresor-Kasenda:feature/enum-contextual-attributes
May 13, 2026
Merged

[13.x] Add enum support to contextual attribute binding#60092
taylorotwell merged 1 commit into
laravel:13.xfrom
Tresor-Kasenda:feature/enum-contextual-attributes

Conversation

@Tresor-Kasenda
Copy link
Copy Markdown
Contributor

This pull request introduces support for PHP enums (both UnitEnum and backed enums) in Container contextual attribute bindings, enhancing the flexibility of dependency injection configuration.

Support UnitEnum and backed enums in Container attribute bindings:

  • Auth, Authenticated, and Cache attributes now accept enum values
  • Updated parameter types to accept UnitEnum|string|null
  • Added comprehensive tests for unit and backed enum bindings
  • Tests cover AuthGuardUnitEnum, AuthGuardBackedEnum, CacheStoreUnitEnum, and CacheStoreBackedEnum

Support UnitEnum and backed enums in Container attribute bindings:
- Auth, Authenticated, and Cache attributes now accept enum values
- Updated parameter types to accept UnitEnum|string|null
- Added comprehensive tests for unit and backed enum bindings
- Tests cover AuthGuardUnitEnum, AuthGuardBackedEnum, CacheStoreUnitEnum, and CacheStoreBackedEnum
@taylorotwell taylorotwell merged commit 7898d05 into laravel:13.x May 13, 2026
54 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