Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] Add BackedEnum support to Authorize middleware #52679

Merged

Conversation

diaafares
Copy link
Contributor

Hi,
Using Enums enhances code readability and reduces typos; it also improves IDE support by providing better autocomplete

After merging this PR #52561
I tried to use BackedEnums with Authorize::using() but it didn't worked:

 Route::get('/dashboard', [AdminDashboardController::class, 'index'])->middleware(Authorize::using(Abilities::VIEW_DASHBOARD))->name(AdminRoutes::DASHBOARD);

This PR adds support for using BackedEnums with Authorize::using()

This PR is backward compatible and shouldn't bring any breaking changes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants