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