laravel-ide-helper: auth()->user() does not have methods in User model

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?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 15

Most upvoted comments

Can still see this problem as of Laravel 8.30.1. Both auth()->user() and Auth::user() do not show code-completion for User model properties and functions.

I’m using VSCode 1.56.2 and have already generated doc-blocks using IDE Helper package.

I am able to get this working if I edit vendor/laravel/framework/src/Illuminate/Support/Facades/Auth.php and delete line 9 in the docblock: * @method static \Illuminate\Contracts\Auth\Authenticatable|null user()

Then it pulls out the autocomplete information from the _ide_helper.php Class Auth function user() that has a doc block that returns \App\Models\User