Auth::user()
returns \Illuminate\Contracts\Auth\Authenticatable|null
. Which does not have your method.
You can safely ignore this message. Personally I use https://github.com/barryvdh/laravel-ide-helper Which resolves such issues by rewriting the expected output to your User model.