Search code examples
phplaravelphpstorm

Excluding folder from PHPstorm indexing and error searching


I am new to PHPstorm and running Laravel as my main framework. In my vendors folder I have a Model, which I also have imported into my app/models folder, and now it's complaining about two models and functions which the same name, can I exclude the one folder in vendor/?


Solution

    1. Mark such duplicate folder as Excluded (either via right click menu in Project View panel.. or Settings/Preferences | Directories)

    2. Make sure that such excluded folder is not listed under Settings/Preferences | Languages & Frameworks | PHP --> Include paths. If it does -- remove it from there as well.

    Thing is: if Add packages as libraries option of Composer settings in PhpStorm was enabled then the package will be added as "external library" so it's not treated as an actual part of the project (does not participate in error checking/TODOs/usage referencing/refactoring operations etc) .. but it still included when resolving symbols (class names etc) even if it's marked as Excluded.