最佳答案
1) 转到:https://github.com/barryvdh/laravel-ide-helper
2)点击要点
生成的 L5 版本:https://gist.github.com/barryvdh/5227822
3) 点击“Raw”获取当前版本(截至 2016 年 6 月 22 日):
4)确保您位于根目录(这是我的)
cd /var/www/html/project
5)下载要点:
wget https://gist.githubusercontent.com/barryvdh/5227822/raw/4d4b0ca26055fa4753b38edeb94fad2396c497c0/_ide_helper.php
6) 将“_ide_helper.php”添加到.gitignore
文件
sudo nano .gitignore
在底部新行添加“_ide_helper.php”
7) 将 .gitignore
和 _ide_helper.php
文件下载到 PhpStorm
这就是我的 PhpStorm 项目目录之后的样子:
8) 文件下载到 PhpStorm 后,“未定义的类”错误将消失,并且自动补全功能现在可以工作。可能需要重新启动它。
关于laravel - 未定义的类路由(PhpStorm 中的 Laravel),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37419143/