为PhpStorm添加Laravel 代码智能提示功能
1.安装laravel插件
2. 应用 composer 安装 barryvdh/laravel-ide-helper
2.1 右键打开composer 搜索laravel-ide-helper
2.2 安装aravel-ide-helper
找到barrvdh/laravel-ide-helper 进行安装,需要花一些时间进行文件下载。
2.3 配置模块
安装成功后,在 项目中的 conifg/app.php 的providers的数组中添加类的支持
<pre style="box-sizing: border-box; outline: 0px; margin: 0px 0px 24px; padding: 8px; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; white-space: pre-wrap; overflow-wrap: break-word; overflow-x: auto; font-size: 14px; line-height: 22px; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,</pre>
2.4 通过命令行生成 _ide_helper.php文件
在命令行中,到项目的当前目录下执行如下命令:会产生一个新的文件
php artisan ide-helper:generate
2.5 提示功能验证
重启PhpStorm IDE后,验证是否有代码提示功能。