未定义的类Route(PhpStorm中的Laravel) [英] Undefined class Route (Laravel in PhpStorm)
问题描述
如何在PhpStorm中修复此警报?
How can I fix this alert in PhpStorm?
还有路线和其他外立面如何自动补全?
And also how to get autocompletion for Route and other Facades?
推荐答案
检查播客演练
1)转到: https://github.com/barryvdh/laravel-ide-helper
2)单击要点
L5的生成版本: https://gist.github.com/barryvdh/5227822
3)单击原始"以获取当前版本(截至2016年6月22日):
3) Click on "Raw" to get the current version (as of June 22, 2016 it is):
4)确保您位于根目录中(这是我的)
4) Make sure you're in your root directory (this is mine)
cd /var/www/html/project
5)下载要点:
wget https://gist.githubusercontent.com/barryvdh/5227822/raw/4d4b0ca26055fa4753b38edeb94fad2396c497c0/_ide_helper.php
6)在.gitignore
文件中添加"_ide_helper.php"
6) Add "_ide_helper.php" to the .gitignore
file
sudo nano .gitignore
在底部的新行中添加"_ide_helper.php"
Add "_ide_helper.php" on a new line at the bottom
7)将.gitignore
和_ide_helper.php
文件下载到PhpStorm
7) Download the .gitignore
and _ide_helper.php
files into PhpStorm
这是我的PhpStorm项目目录的样子:
This is what my PhpStorm project directory looks like afterwards:
8)将文件下载到PhpStorm后,未定义的类"错误将消失,并且自动补全现在可以正常工作.可能需要重新启动它.
8) After the files are downloaded into PhpStorm, the "Undefined class" error will disappear and autocompletion will now work. Might need to restart it.
这篇关于未定义的类Route(PhpStorm中的Laravel)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!