I
I
Islam Ibakaev2020-12-23 21:31:39
Visual Studio Code
Islam Ibakaev, 2020-12-23 21:31:39

Why does vscode complain about methods from the tymon/jwt-auth package?

I went through the documentation of the package , in particular, I looked at "laravel installation" and "quick start". Repeated - everything works fine. However, vscode complains (underlines in red) about the methods from the package.
5fe38cafaf4ab177352220.png
Tell me how to "calm down" vscode?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Wells, 2020-12-24
@Alex_Wells

These methods are not from some package, but from illuminate / auth, i.e. laravel.
Start using the IDE. VSCode is a code editor. Then at least some support will appear, for example, through the Laravel Plugin + ide-helper.
These methods don't really exist, but it works either because of laravel's stupid magic, or, as in this case, as part of the chance that the Guard returned from auth() will have the necessary methods. I.e. again, the non-existent quality of laravel code, and you can't do anything about it. And no one will, Taylor likes it that way.

J
jazzus, 2020-12-24
@jazzus

This is not vscode swearing, but the Intelephense plugin. Try rewriting with facade
Auth::login($user);
Works for me, but I have a paid version.
It is also mandatory to install laravel-ide-helper , which needs to generate everything including PHPstorm meta, which Intelephense also reads. Well, either score and disable method diagnostics in the plugin settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question