skip to Main Content

In VSCode the PHP intelephense extension version 1.3.7 marks the laravel Facades as classes not found.
Before if you import a Facade like this:

use Log;

and then use it in the file like this:

Log::info('some message');

which is correct there were no issues. Now every usage is marked as a syntax error and you have to import the fully qualified name like the following for the error to go away.

use IlluminateSupportFacadesLog;

Also it didn’t used to complain about the Eloquent class’s methods like find or where etc but now it underlines them as methods not defined.

Is there a way for the extension to ignore these?

2

Answers


  1. You can try barryvdh/laravel-ide-helper.

    it makes VScode to refer Facade files.

    example)

        "require-dev": {
            ...
            "barryvdh/laravel-ide-helper": "^2.7",
            ...
        },
    
    Login or Signup to reply.
  2. A solution which is really a life saver here is the php namespace resolver extension, it gives you all the possible options that you want as a dropdown menu.

    Here is the link

    Here I don't have a the required category controller in my api.php routes, what I just need to do is go to my route where my controller is defined

    Right click on my class which I want to add and click import

    If there are multiple options, VS Code will show me a drop down from command palette to, I just have to select the right one and simply add it

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search