IDE not recognizing Auth::user()->can();
?
#1808
Answered
by
erikn69
richoandika
asked this question in
Q&A
-
Can we calling using Originally posted by @richoandika in #1287 (comment) |
Beta Was this translation helpful? Give feedback.
Answered by
erikn69
Apr 10, 2023
Replies: 2 comments 4 replies
-
I found a little idea to get rid of the error. I added a new function in the User model: |
Beta Was this translation helpful? Give feedback.
1 reply
-
Try /** @var \App\Models\User $user */
$user = Auth::user();
$user->can('dfdf') |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/** @var \App\Models\User $user */
weird, that comment must have told your IDE the class returned by the method