laravel - 未定义的类路由(PhpStorm 中的 Laravel)

标签 laravel autocomplete phpstorm laravel-facade

如何修复 PhpStorm 中的此警报?

enter image description here

以及如何获得路线和其他外观的自动完成功能?

最佳答案

检查Laracasts walkthrough

1) 转到:https://github.com/barryvdh/laravel-ide-helper

2)点击要点

生成的 L5 版本:https://gist.github.com/barryvdh/5227822

3) 点击“Raw”获取当前版本(截至 2016 年 6 月 22 日):

https://gist.githubusercontent.com/barryvdh/5227822/raw/4d4b0ca26055fa4753b38edeb94fad2396c497c0/_ide_helper.php

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 项目目录之后的样子:

enter image description here

8) 文件下载到 PhpStorm 后,“未定义的类”错误将消失,并且自动补全功能现在可以工作。可能需要重新启动它。

enter image description here

关于laravel - 未定义的类路由(PhpStorm 中的 Laravel),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37419143/

相关文章:

php - 为什么 "@foreach($pastRegistrations as $pastRegistration)"也返回结果?

javascript - 自动完成 HTML 中可用的 CSS 类 Eclipse 中的 JavaScript jQuery

.net - 快速中缀搜索

java - JComboBox 搜索列表

intellij-idea - 如何在不离开主行的情况下在Rubymine/PHPStorm/其他JetBrains IDE中的特定目录中创建文件

phpstorm - 在 PHPStorm "Non-code usages"中禁用 "Find usages"

eclipse - 在任何 IDE 中每次 SVN 提交后自动填充changelog.txt

php - Laravel 5 - 分形更改器(mutator) - 将参数发送到更改器(mutator)以缩小响应范围

angularjs - 因为我现在正在使用 Laravel,所以我应该学习 Vuejs/Angular/React 吗?

PHPUnit: "Class ' Eloquent' not found"when using @dataProvider