Search code examples
phplaravelvisual-studio-codeintelephense

Undefined type 'Auth' in Laravel routes Visual Studio Code


laravel>routes>web.php file in visual studio code IDE

I'm new to Laravel. The Visual Studio code shows an error on my Laravel project laravel>routes>web.php file but the program runs fine without any errors.

Any explanation on how this works?


Solution

  • Use this code in your routes/web.php file

    use Illuminate\Support\Facades\Auth;
    

    Or just use:

    use Auth;