一、扩展的地址
https://github.com/barryvdh/laravel-ide-helper
二、安装扩展
1、引入库:
composer require barryvdh/laravel-ide-helper
composer require doctrine/dbal
如果只想在开发环境上使用,请加上--dev
composer require --dev barryvdh/laravel-ide-helper
composer require --dev doctrine/dbal
2、在config/app.PHP的 providers 数组中添加:
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class
4、如果想每次提交时自动更新文档,可以配置composer.json
"scripts":{
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate","PHP artisan ide-helper:generate","PHP artisan ide-helper:Meta"
]
},
5、由于扩展会生成相应的文件,可能只针对当前开发者有用,所以需要添加到.gitignore中
原文链接:https://www.f2er.com/laravel/539094.html