It's because the routes get read from the controller namespace by default.
This is something you'll have to change within PhpStorm. Do you use this plugin? https://github.com/Haehnchen/idea-php-laravel-plugin/issues/35
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I use PHP storm. In my routes file i use the autofill option to get the namespace of a method on a controller like this
Route::get('/home/dashboard', 'App\Http\Controllers\Backend\Home\DashboardController@index')->name('dashboard');
The problem is that this namespace that is generated errors in: ReflectionException (-1) Class App\Http\Controllers\App\Http\Controllers\Backend\Home\DashboardController does not exist
when i manualy change it to Backend\Home\DashboardController@index
then it does work.... in my controller i have the namespace namespace App\Http\Controllers\Backend\Home;
why does the full path dont work? and how can i make it work,, or make phpstorm autofill with the correct namespace
Please or to participate in this conversation.