Posts Learn Components Snippets Categories Tags About
/

Make PHPStorm Smarter with Laravel IDE Helper

Learn how to make PHPStorm smarter with autocompletion to provide better programming experience with Laravel IDE Helper Generator.

Created on Jul 28, 2021

17 views

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.

Snippets by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

Load comments for Make PHPStorm Smarter with Laravel IDE Helper

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components

Other Code Snippets

More