Install Laravel IDE Helper Generator
Use composer to install the package.
composer require --dev barryvdh/laravel-ide-helper
Generate the Helper File
Run the command below to generate the helper file. The necessary file will be automatically generated and you might need to restart PHPStorm to let it reindex the files.
php artisan ide-helper:generate php artisan ide-helper:meta
Automate Helper File Generation
Sometimes it's better to automate the helper file generation such as after updating composer dependencies. To set this up you can update the "scripts" part of your composer.json file like below.
"scripts": { "post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", "@php artisan ide-helper:generate", "@php artisan ide-helper:meta" ] },
So now when you run "composer update" the post-update command will be triggered and the helper will be generated.
Leave a reply