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

Allow backed enums to be passed to Route::can() #1

Closed
wants to merge 2 commits into from

Conversation

Omegadela
Copy link
Owner

@Omegadela Omegadela commented Sep 14, 2024

Hi,

This PR proposes to add BackedEnum support to the can method on \Illuminate\Routing\Route, allowing to use it inline for simple routing.

Route::post('/request', function () {...})->can(Permissions::CAN_REQUEST);

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

@Omegadela Omegadela force-pushed the route-can-backed-enums branch from cdb5098 to facb6e6 Compare September 14, 2024 15:18
@Omegadela Omegadela force-pushed the route-can-backed-enums branch from facb6e6 to 594c45a Compare September 14, 2024 15:23
@Omegadela Omegadela closed this Dec 30, 2024
@Omegadela Omegadela deleted the route-can-backed-enums branch December 30, 2024 13:44
# 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.

1 participant