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

brakkar's avatar

Phpstorm: Multiple definitions exist for class

Hi, this message started appearing all over my files since the latest phpstorm update. To remove this warning all solutions say to look into : Settings/Preferences | Editor | Inspections | PHP | Undefined | Undefined class, it has "Don't report multiple class declaration potential problems" checkbox.

But mine DOESN'T have the checkbox in there. It only has an ignore PHPdocs which doesn't change the problem.

So where to disable this inspection?

0 likes
7 replies
Sinnbeck's avatar

What class is it? Try ctrl+click on it to see what classes matches. For me it was some .stub files. So I just set phpstorm to ignore .stub files, and the error was gone.

brakkar's avatar

@Sinnbeck It's literally all my custom models. It's due to the laravel ide helper model file I think, but it was never an issue until the phpstorm upgrade from today.

Sinnbeck's avatar

@brakkar Did you check by ctrl+click when it gives the message? I thought the same, but was wrong.

1 like
brakkar's avatar

@Sinnbeck Thanks for help. Activating the Laravel Idea plugin resolved the problem... so I guess it made phpstorm smarter and the problem is now gone.

1 like
privatebox's avatar

Deleting /vendor/_idea_laravel/ directory also fixes this

1 like
toddmcbrearty's avatar

moving the directory out of vendor worked best for me in PHPStorm

settings->Languages & Frameworks->Laravel Idea->Helper Code

under the Helper files directory i changed that to .larave-idea and set that directory to excluded.

1 like
parijke's avatar

It is in undefinded symbols -> multiple class declerations

Please or to participate in this conversation.