PHPstorm w/ Laravel, Exclude vender models if found in app/model folder
Hey, I am new to PHPstorm, and I am having some troubles with it giving me squiggely underlines because it is finding my Model in both the Vender folder from Composer, but also in my actual Models folder in app/models.
Is there a way to set a prefered location, e.g. It will always pick app/ over vendor/?
Thanks.
请先登录再写评论。
Hi there,
No.
You should mark one of such duplicate folders as Excluded (either via right click menu in Project View panel.. or "Settings | Project | Directories")
I have tried this, but it does not fix my problem.
Here you can see that my attempt was in vain, as it still have the squiggely line beneth it.
http://gyazo.com/e91e0514cefdf67c0f111872ff87aeed
Works fine for me. Need more details to suggest anything else.
1) What do you see when Ctrl+Click on such class name? screenshots please.
2) Have you tried "File | Invalidate Caches..." and restart after marking folder as excluded?
3) Maybe you have more than 2 classes with the same name..? E.g. it could be included via symbolic link or something...
More details please.
1) http://i.imgur.com/68RMo2j.png
2) That did not work
3) I do not, I am absolutely positive that there's only those two, and you can also see it does only detect the two when I ctrl-click the name.
What do you have at "Settings | PHP | Include paths" -- maybe that package is listed there as well (could be if it was installed via composer which was controlled by PhpStorm)?
If you open such duplicate unwanted file -- what color the tab will have?
1) It is also listed there, as it is installed via composer, and it should be installed via composer, and therefore I cannot I remove it, in case I need to update it.
2) It has the standard yellow folder color.
Please remove it from "PHP | Include paths" (you can always add it back later if you need it there).
The reason it's listed there because option to "Add composer packages as libraries" was enabled.
It has nothing to do with ability to update package via composer (especially if it's a duplicate code).
Ah okay, I'll do that. Thanks :)