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

lemmon's avatar
Level 28

PhpStorm says Undefined class 'Route' in routes/web.php file

Route is highlighted and when I mouse over the message is "Undefined class 'Route'" but it all works fine, Also the Auth is highlighted with the same message but it all works. How can I get rid of the false import suggestion?

Route::group(['middleware' => 'auth'], function () {
    Route::get('/projects', 'ProjectsController@index');
    Route::get('/projects/{project}', 'ProjectsController@show');
    Route::post('/projects', 'ProjectsController@store');
});

Auth::routes();

Thank's Henry

0 likes
2 replies

Please or to participate in this conversation.