Laravel Intellisense/使用PhpStorm自动完成 [英] Laravel Intellisense / autocomplete with PhpStorm

查看:283
本文介绍了Laravel Intellisense/使用PhpStorm自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图获得一个干净的环境以在Laravel 5.4/PhpStorm上工作. 遵循以下所有说明: https://github.com/barryvdh/laravel-ide-helper (包括安装PhpStorm Laravel插件)

Trying to get a clean environment to work on Laravel 5.4 / PhpStorm. Followed all the instructions from: https://github.com/barryvdh/laravel-ide-helper (including installing the PhpStorm Laravel plugin)

已获得生成的文件_ide_helper.php,已添加

Got the file_ide_helper.php generated, added

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,

移至正确位置,清除缓存,重新启动...

to its proper location, cleared cache, restarted...

请查看所附图片,我应该由ide helper来解决缺乏智能的感觉吗?

Please look at attached image, is the lack of intellisense I get supposed to be fixed by the ide helper ?

推荐答案

好的,如果您已经安装了帮助程序,则可以使用以下解决方案:

Ok here is the solution, assuming you have installed the helper already:

示例:

替换控制器:

use Illuminate\Support\Facades\Validator;

通过

  use Validator

在您的config/app.php中,您必须具有以下别名:

In your config/app.php you must have this alias:

'Validator' => Illuminate\Support\Facades\Validator::class,

就我而言,它已经在那里.

In my case it was already there.

此后,如上图所示,该示例不再显示错误消息,并且我可以使用phpstorm的全部功能来正确理解:: make方法.

After this, no more error message for the example shown in the image above and I can use full power of phpstorm that correctly understands the ::make method.

来源 https://github.com/barryvdh/laravel-ide-helper/issues/431#issuecomment-275898789 谢谢@lazyone.

Source https://github.com/barryvdh/laravel-ide-helper/issues/431#issuecomment-275898789 thanks @lazyone.

这篇关于Laravel Intellisense/使用PhpStorm自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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