https://github.com/barryvdh/laravel-ide-helper
composer require --dev barryvdh/laravel-ide-helper
config/app.php:
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
5.5及以上版本不需要设置
app/Providers/AppServiceProvider.php:
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
// ...
}
conposer.json:
"scripts":{
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta"
]
},
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
config/ide-helper.php:
'include_fluent' => true,
'include_helpers' => true,