Repolode
barryvdh

barryvdh/laravel-ide-helper

Generates PHPDoc files for Laravel facades and Eloquent models so IDEs like PhpStorm can autocomplete accurately.

Stars
14,972
Forks
1,194
Open issues
195
Last commit
4 days ago

What is it?

IDE Helper for Laravel is a Composer dev dependency that generates helper files from your project's own code, so editors can offer accurate autocompletion. Running `php artisan ide-helper:generate` produces a file describing Laravel facades, and `ide-helper:models` writes PHPDocs for Eloquent models based on table columns, relations, and getters/setters.

The package also creates PhpStorm meta files via `ide-helper:meta`, which let the IDE infer the class returned by container lookups such as `app('events')`. Additional options cover macros, Fluent migration methods, factory builders, real-time facades, and custom relationship types. Model output can be written into model files, placed in a separate file, or added as a `@mixin` reference.

The 3.x branch supports Laravel 10 and later; older Laravel versions use the 2.x releases.

Key features

  • 01Generates facade autocompletion files with `ide-helper:generate`.
  • 02Writes model PHPDocs for columns, relations, and accessors.
  • 03Creates PhpStorm meta files for container resolution.
  • 04Supports writing model docs to separate files via mixins.
  • 05Handles macros, Fluent migration methods, and factory builders.

Use cases

  • Getting accurate autocomplete for Eloquent model attributes and relations in PhpStorm.
  • Keeping IDE hints in sync after schema or dependency changes by re-running the generator.
  • Helping IDEs understand facades and container bindings in a Laravel project.

Quick start

  1. 1

    Install the package as a dev dependency with Composer

    composer require --dev barryvdh/laravel-ide-helper
  2. 2

    Generate facade autocompletion file

    php artisan ide-helper:generate
  3. 3

    Generate PHPDocs for your models and write them into the model files

    php artisan ide-helper:models -RW

Things to know

  • Model PHPDoc generation requires a working database connection.
  • The 3.x branch supports Laravel 10 and later; older Laravel versions need the 2.x releases.

Topics

FAQ

What is laravel-ide-helper?
Generates PHPDoc files for Laravel facades and Eloquent models so IDEs like PhpStorm can autocomplete accurately. IDE Helper for Laravel is a Composer dev dependency that generates helper files from your project's own code, so editors can offer accurate autocompletion. Running `php artisan ide-helper:generate` produces a file describing Laravel facades, and `ide-helper:models` writes PHPDocs for Eloquent models based on table columns, relations, and getters/setters.
Is laravel-ide-helper free to use? What license does it have?
laravel-ide-helper is open source under the MIT license. Check the license terms before using it in commercial products.
Is laravel-ide-helper still maintained?
Actively maintained. The last commit to laravel-ide-helper was on Nov 3, 2026.
What can I use laravel-ide-helper for?
Getting accurate autocomplete for Eloquent model attributes and relations in PhpStorm. Keeping IDE hints in sync after schema or dependency changes by re-running the generator. Helping IDEs understand facades and container bindings in a Laravel project.
How do I install laravel-ide-helper?
Install the package as a dev dependency with Composer: composer require --dev barryvdh/laravel-ide-helper Generate facade autocompletion file: php artisan ide-helper:generate Generate PHPDocs for your models and write them into the model files: php artisan ide-helper:models -RW
Where can I get laravel-ide-helper?
The source code and installation instructions are on GitHub: https://github.com/barryvdh/laravel-ide-helper

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects