-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Gate::after method not update results #50097
Comments
Heya, thanks for reporting. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up. laravel new bug-report --github="--public" Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Hi @driesvints, thanks for the fast response! I followed your instructions reproduced the issue in this repository: https://github.com/MertcanDinler/laravel-gate-bug. and i fix at #50098 pull request |
After reviewing this, it seems the current behaviour is the expected one. |
@driesvints I think the function does not perform the function described in the document. Can you explain the purpose of the function? |
@MertcanDinler it's a catch all for when no conditions were hit. |
I think the documentation needs to be updated to be more descriptive of this method. |
Laravel Version
10.44.0
PHP Version
8.3
Database Driver & Version
No response
Description
This is how the Gate::after method is described in the Laravel documentation. However, it does not function as described. Instead, it returns the result prior to calling the 'callAfterCallbacks' method if the parameter '$result' is non-null.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: