Home / Snippets / Make PHPStorm Smarter with Laravel IDE Helper
Make PHPStorm Smarter with Laravel IDE Helper cover

Make PHPStorm Smarter with Laravel IDE Helper

1.1K

3 years ago

0 comments

To make your PHPStorm smarter, you can make use Laravel IDE Helper Generator where it will generate all of the necessary helper files for the project. By having it installed, it will help PHPStorm to index all the necessary files for better autocomplete, inspection, tracing, and more.

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.
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this