https://github.com/barryvdh/laravel-ide-helper
安裝
composer require --dev barryvdh/laravel-ide-helper
設(shè)置服務(wù)提供者
config/app.php:
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
5.5及以上版本不需要設(shè)置
設(shè)置只在開發(fā)環(huán)境中加載
app/Providers/AppServiceProvider.php:
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
// ...
}
設(shè)置自動更新
conposer.json:
"scripts":{
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta"
]
},
發(fā)布配置文件
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
設(shè)置鏈?zhǔn)秸{(diào)用支持湘捎、為函數(shù)生成幫助文件
config/ide-helper.php:
'include_fluent' => true,
'include_helpers' => true,