Skip to content

IDE Helper

Generates PHPDoc files so your IDE can autocomplete Laravel facades, models, and more.barryvdh/laravel-ide-helper

Stars
15k
Forks
1.2k
Licence
MIT
Language
PHP
Last update
2 months ago
Type
Dev tool

What it is

This is a Composer package for Laravel projects. It reads your project's code and generates helper files that let your code editor offer accurate autocompletion and type hints for Laravel facades and Eloquent models. Because it generates from your current files, the helpers can be regenerated whenever the project changes.

  • Generate _ide_helper.php so the editor can autocomplete Laravel facade methods
  • Generate model PHPDocs listing properties, relations, and query methods
  • Create a PhpStorm meta file for container instances with php artisan ide-helper:meta
  • Add the generator commands to composer.json so helpers refresh after dependency updates

Great for

  • Laravel developers who use an IDE such as PhpStorm or VS Code and want better autocompletion
  • Teams on Laravel 10 or later, since the 3.x branch supports that range
  • Projects with Eloquent models that want generated property and method PHPDocs

Not ideal for

  • Projects on Laravel versions older than 10, which the README says should use the 2.x releases instead
  • Setups without a working database connection, since model generation requires one and some facades may be skipped
  • Sublime Text users without extra tooling, since the README says CodeComplice is needed there
Step-by-step guide: how to use IDE HelperInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: PHP · Composer · Laravel 10 or later for the 3.x branch

    Install as a dev dependency

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

    Run it

    • Install the package with the Composer command above
    • Run php artisan ide-helper:generate to create _ide_helper.php
    • Run php artisan ide-helper:models -RW to add PHPDocs to your models, after backing them up
    • Run php artisan ide-helper:meta to create the PhpStorm meta file if you use PhpStorm
  3. 3

    Get the most out of it

    • Add ide-helper:generate and ide-helper:meta to the post-update-cmd scripts in composer.json to refresh helpers after updates
    • Use --write-mixin (-M) to keep generated PHPDocs in a separate file and avoid duplicate results in your IDE
    • Use the -M option on facade generation when there is no working database connection to create an in-memory SQLite connection
    • Publish the config file to change class mappings, default helpers, or ignored models

Downloads

Strengths

  • Generated from your project files, so the helpers track the code as it changes
  • Offers several output options, such as separate files or mixin tags, to avoid duplicate-declaration warnings
  • Widely used, with an MIT license and a public test badge in the README

Trade-offs

  • Model generation needs a working database connection to read table columns
  • The README warns to back up models before writing PHPDocs into them, and resetting can remove custom comments
  • Some real-time facade and macro features depend on framework cache files or type hints being present

How it compares

ProjectStarsTypeLevelUpdatedBest for
laravel-ide-helper (this)15kDev toolbeginner2 months agoLaravel developers who use an IDE such as PhpStorm or VS Code and want better autocompletion
filament32.4kLibraryintermediate4 days agoLaravel developers building internal admin panels
coc.nvim25.1kAppintermediate10 days agoVim or Neovim users who want autocompletion and language features similar to VS Code
laravel-debugbar19.3kLibrarybeginner9 days agoLaravel developers investigating slow pages or unexpected database queries
sage13.3kFrameworkintermediate29 days agoDevelopers building custom WordPress themes
ui127kLibraryintermediate4 days agoDevelopers building React or Next.js interfaces who want full control over component code

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.