PhpStorm无法识别方法

Bra*_*rad 1 php ide phpstorm laravel laravel-5

所以这个问题已经被问了好几次了,但是我还没有找到有效的答案。

我正在使用PhpStorm-2016.3.2和Laravel 5.4

在此处输入图片说明

我已经尝试使用https://github.com/barryvdh/laravel-ide-helper以及PhpStorm的Laravel插件。

我尝试检查“在类中存在降级严重性if_magic方法”选项-无法正常工作。

解决此问题的唯一方法是完全关闭未定义方法的警告,但是关闭此类功能将无法使用IDE。

有没有人找到解决这个问题的方法?

资料来源:

https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/15

https://laracasts.com/discuss/channels/general-discussion/why-does-phpstorm-not-recognise-all-the-classes?page=1

找不到PhpStorm Laravel 5方法

https://github.com/barryvdh/laravel-ide-helper

Leo*_*lla 6

PHPDoc块可以派上用场。

您可以在函数内部的语句返回$ query之前添加此PHP注释。

/** @var $query \Illuminate\Database\Query\Builder */
Run Code Online (Sandbox Code Playgroud)

这样,PHPStorm将正确识别该方法