Visual Sudio Code does not resolve Laravel Facades even with PHP Intelephense extension and _ide-helper.php file generated by laravel-ide-helper. When I add _ide-helper.php while the workspace is open, Facades are resolved, however it won’t be resolved when I reopen the workspace later.
Any of below I tried did not solve this issue.
- Put _ide-helper.php at the root of the workspace.
- Restart VSCode.
- Add _ide-helper.php path to Intelephense “Include Path” settings.
- Tried with both relative and absolute paths, also in both User and Workspace settings.
- Tried with the directory path where _ide-helper.php is located.
You might get some hints to find the cause by opening Intelephense output.
Open OUTPUT by selecting Output menu under View menu, then select “intelephense” to see its output.
In my case, as seen in the screenshot, the cause was Max Size settings of Intelephense.
It was set to 1,000,000 bytes, while my _ide-helper.php was 1.1MB.
After I set Max Size settings to more than 1.1MB, _ide-helper.php was properly loaded and Facades were resolved.
Hope this helps someone.