A Composer package for Laravel apps that builds helper files and PHPDoc so IDEs can autocomplete facades, models, fluent APIs, and container bindings from your project source.
Overview
Laravel IDE Helper generates helper artifacts tailored to your application so editors can offer accurate autocompletion for Laravel-specific APIs. Output is derived from files in your project and can be regenerated whenever dependencies or code change.
The php artisan ide-helper:generate command produces an idehelper.php file (name configurable) that documents facades, optional helper functions, macros with type hints, and real-time facades. It can use an in-memory SQLite connection when a default database is unavailable, and composer hooks can rerun generation after dependency updates.
php artisan ide-helper:models introspects model tables and relationships to add PHPDocs for properties and related methods. You can write comments into model classes, emit a separate ide-helper models file, or add only a mixin tag; reset mode replaces existing docblocks. Options control magic where methods, relation count or exists attributes, generics annotations, external builder methods, and custom relationship types.
Additional commands cover PhpStorm container meta (.phpstorm.meta.php) for IoC resolution hints and optional factory builder return types in configuration. Fluent migration helpers and model hooks let you extend generation when defaults are insufficient. The package targets recent Laravel releases on the current major branch, with older Laravel versions supported by prior releases.
Key features
- Facade PHPDoc via ide-helper:generate
- Model property docs from database schema
- PhpStorm meta for container bindings
- Configurable output filenames and directories
- Macro and mixin documentation support
- Fluent migration method completions
- Model hooks for custom metadata
- Composer post-update regeneration hooks
Use cases
- Autocomplete Laravel facades in PhpStorm
- Document Eloquent models without manual PHPDoc
- Keep IDE helpers in sync after composer updates
- Mixin-only model docs to avoid duplicates
- IoC factory pattern hints in PhpStorm