1、安装
#开发环境
>composer require barryvdh/laravel-ide-helper --dev
2、配置
dev开发环境配置
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
// ...
}
config配置文件生成
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
3、使用
#为Facades生成注释
php artisan ide-helper:generate
#为数据模型生成注释
php artisan ide-helper:models
#生成PhpStorm Meta file
php artisan ide-helper:meta