https://github.com/barryvdh/laravel-ide-helperphp
下载 https://gist.github.com/barryvdh/5227822 中的 _ide_helper.php
,放置于项目根目录。laravel
引入库:git
composer require barryvdh/laravel-ide-helper
在 config/app.php
的 providers 中添加:github
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
生成辅助文件:json
php artisan ide-helper:generate
提示:须要首先清除 bootstrap/compiled.php
,因此生成前须要执行 php artisan clear-compiled
,生成后执行 php artisan optimize
。bootstrap
配置 composer.json 以在每次提交以后执行。app
"scripts":{ "post-update-cmd": [ "php artisan clear-compiled", "php artisan ide-helper:generate", "php artisan optimize" ] },