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

[10.x] Fixes $request->user() or Auth::user() run query each time if token doesn't exists #49205

Closed
wants to merge 1 commit into from

Conversation

crynobone
Copy link
Member

fixes #49201

…en doesn't exists

fixes #49201

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone marked this pull request as draft December 1, 2023 05:14
@crynobone crynobone marked this pull request as ready for review December 1, 2023 07:34
@driesvints driesvints changed the title Fixes $request->user() or Auth::user() run query each time if token doesn't exists [10.x] Fixes $request->user() or Auth::user() run query each time if token doesn't exists Dec 1, 2023
@taylorotwell
Copy link
Member

Don't think we should fix - probably could break some other use case. I think if $request->user() returns null once (meaning unauthenticated) you wouldn't keep calling it over and over again in your app.

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.

$request->user() or Auth::user run query each time if token doesn't exists
2 participants