Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use Gate facade directly #716

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Use Gate facade directly #716

merged 1 commit into from
Dec 18, 2024

Conversation

jasonmccreary
Copy link
Collaborator

Laravel 11 has marked the "base controller" as abstract and no longer includes the previous traits. As such, methods like middleware, 'validate, authorize`, etc are no longer available.

Currently, Blueprint only uses authorize and authorizeResource methods. This PR updates the former to use the Gate facade directly to avoid errors in Laravel 11 (#701).

Note: There does not seem to be an equivalent for authorizeResource on Gate. For now, this is left as $this->authorizeResource for compatibility with Laravel 10. If you require this method in a Laravel 11 app, you may import the AuthorizeResource trait in your controller. However, this trait and method do not appear to be use within Laravel and may be removed in future versions of Laravel and Blueprint.

@jasonmccreary jasonmccreary merged commit 90730bf into master Dec 18, 2024
27 checks passed
@jasonmccreary jasonmccreary deleted the gate-authorize branch December 18, 2024 16:20
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.

1 participant