未定义的类路由(PhpStorm 中的 Laravel) [英] Undefined class Route (Laravel in PhpStorm)

查看:39
本文介绍了未定义的类路由(PhpStorm 中的 Laravel)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 PhpStorm 中修复此警​​报?

还有如何让 Route 和其他 Facades 自动完成?

解决方案

查看

8) 将文件下载到 PhpStorm 后,未定义类"错误将消失并且自动完成现在将起作用.可能需要重新启动它.

How can I fix this alert in PhpStorm?

And also how to get autocompletion for Route and other Facades?

解决方案

Check the Laracasts walkthrough

1) Go to: https://github.com/barryvdh/laravel-ide-helper

2) Click on the gist

Generated version for L5: https://gist.github.com/barryvdh/5227822

3) Click on "Raw" to get the current version (as of June 22, 2016 it is):

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

4) Make sure you're in your root directory (this is mine)

cd /var/www/html/project

5) Download the gist:

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

6) Add "_ide_helper.php" to the .gitignore file

sudo nano .gitignore

Add "_ide_helper.php" on a new line at the bottom

7) Download the .gitignore and _ide_helper.php files into PhpStorm

This is what my PhpStorm project directory looks like afterwards:

8) After the files are downloaded into PhpStorm, the "Undefined class" error will disappear and autocompletion will now work. Might need to restart it.

这篇关于未定义的类路由(PhpStorm 中的 Laravel)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆