If you have Settings/Preferences | Languages & Frameworks | PHP | Composer | Add packages as libraries, packages inside vendor should be marked as Library roots and be protected automatically.
You also can achieve that effect manually:
Exclude the vendor directory at Settings/Prefrences | Directories.
Add it to Settings/Preferences | Languages & Frameworks | PHP | PHP Include.
If you have
Settings/Preferences | Languages & Frameworks | PHP | Composer | Add packages as libraries, packages insidevendorshould be marked as Library roots and be protected automatically.You also can achieve that effect manually:
vendordirectory atSettings/Prefrences | Directories.Settings/Preferences | Languages & Frameworks | PHP | PHP Include.It only hides the files.
I want to see them but they will be protected from editing.
No. It notifies you that you are trying to edit the protected file.
Plus, such files have different background color, which you can change to make more obvious/standing out.
P.S. Try applying Read-Only attribute to them then (no ideas about Mac/Linux, but on Windows that works well).
For me, just excluding wasn't enough. Further confusingly, Windows (host machine) was showing the directory as read only.
In my vm I recursively removed write access and that did the trick.
```
chmod -w -R vendor
```
The name of the feature that you're looking for that creates a hard stop to editing protected files is: Non-Project Files Protection dialog
https://www.jetbrains.com/help/phpstorm/2020.2/non-project-files-access-dialog.html
After an upgrade (to 2024.1.2), this feature has not been working anymore. Repairing IDE did nothing except taking a lot of time.
The solution: go to Settings→PHP→composer→Add packages as libraries. Disable and enable again, apply, wait.
Basic feature always broken after ervery update… No QA as it seems anymore, regressions all over the place…