A Laravel package that automatically caches Eloquent model and relationship queries and invalidates them when models change.
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
Install the package as a dev dependency with Composer
composer require --dev barryvdh/laravel-ide-helper - 2
Generate facade autocompletion file
php artisan ide-helper:generate - 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
A Laravel package that captures slow database queries, groups repeats, and uses an LLM to suggest indexes and query rewrites, with a built-in dashboard.
A self-hosted, browser-based cloud IDE forked from and rewritten from the Codiad project, installed on a PHP web server.
A Lua-based Neovim configuration framework with a polished UI, theme switcher, and fast startup via lazy loading.
Wave is a Laravel-based SaaS starter kit that provides authentication, billing, subscription plans, roles and permissions, and admin tooling out of the box.
Self-hosted, open-source Linktree alternative for building a personal page that collects all your links in one place.