How to avoid 'Multiple definitions exist for class' problems when using Laravel IDE Helper and PhpStorm

PhpStorm

In order to avoid 'Multiple definitions exist for class' problems when using Laravel IDE Helper and PhpStorm, do the following:

PhpStorm -> Settings -> Directories -> Exclude files: _ide_helper_models

Reference: https://github.com/barryvdh/laravel-ide-helper/issues/592#issuecomment-1666504148

If you're using Laravel Idea, make sure you have enabled it.

image.png 193.71 KB

There are other folks not getting this right:

https://laracasts.com/discuss/channels/laravel/phpstorm-multiple-definitions-exist-for-class?page=1&replyId=898518