Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nick7's avatar
Level 2

PhpStorm: Undefined class 'Route' (Cannot find declaration to go to)

I have many "Undefined ...." with PhpStorm in fresh installations.

Undefined class 'Route' (Cannot find declaration to go to)

Undefined namespace 'Facades'

Undefined function 'view'

I red this.: https://laracasts.com/discuss/channels/laravel/phpstorm-says-undefined-class-route-in-routeswebphp-file

I had installed barryvdh/laravel-ide-helper, and published in ServiceProvider, run php artisan ide-helper:generate, ... model, ...meta But no effect.

What can I do else?

All new versions Laravel 7 or 8, PhpStorm 2020.2 (also plugin Laravel installed and enabled to project)

0 likes
3 replies
laracoft's avatar

Visual Studio Code (VSCode) is a very competitive free alternative which you might want to consider.

Nick7's avatar
Level 2

Yes i have. But i think some features are in VSC not available.

But it must work with Phpstorm, otherwise so many laravel coder would not use it.

Nick7's avatar
Level 2

Now it works. My issue was. I handle the files local (wihout server) and deploy remote (server). The relevant files were remote available but not in my local folder (Phpstorm source). After copy remote to local it works.

1 like

Please or to participate in this conversation.