Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm problem with recognizing namespaces, models and controllers

I have some problem with my PhpStorm (ver 2020.2). You can see on pictures, models, controllers and namespaces aren't recognized by PhpStorm, but application is working perfect.

Someone knows how to fix that problem in PhpStorm?

Namespaces

Controllers

like image 964
jovi Avatar asked Oct 23 '25 17:10

jovi


2 Answers

For me, the solution was to close IDE from File > Close Project, then remove .idea folder rm -rf .idea from terminal, and finally reopening it fixed the issue.

like image 168
Pezhvak Avatar answered Oct 26 '25 06:10

Pezhvak


You have to define the namespaces in the Settings
Go to Settings > Directories and edit the properties for each namespace enter image description here

On the Source Folders edit the prefix to be App\

enter image description here

like image 45
ml59 Avatar answered Oct 26 '25 06:10

ml59