I dont think you can do that because ypur IDE has no idea that auth()->user() helper relates to the User class
Jan 16, 2019
7
Level 37
auth()->user() does not have methods in User model(laravel-ide-helper)
Hi I have trouble with autocompleting methods in User model when I use auth()->user()
so I have a method foo in User model, and when I use auth()->user() to get the login user instance I do not have the foo method show up.
can some one tell me what congfig I need to do?
Level 35
I like to create a helper method user(). This is short and you can set your own return statement.
Or you could use \Auth::user() this does have the following return statement: @return \App\User|null (with the help of the ide-helper library)
1 like
Please or to participate in this conversation.