barryvdh/laravel-ide-helper
Generates up-to-date PHPDoc helper files for Laravel to improve IDE autocomplete and type hints. Creates _ide_helper.php for facades and writes or exports model docblocks for Eloquent, fluent methods, factories, and container bindings.
storage/framework/cache, ensuring dynamic facade methods are included. This is a niche but powerful feature for large applications.--dev), and generation is triggered via Artisan commands. No runtime overhead during production.ModelHookInterface implementations introduce maintenance overhead for non-standard model logic.ModelHookInterface implementations? If so, how will these be tested and maintained?composer update (if using post-update-cmd)?composer update (via post-update-cmd).ide-helper:generate) in a non-critical branch.Auth, Cache, Route).ide-helper:models) for high-impact models (e.g., User, Post).--nowrite initially to avoid modifying model files, then switch to --write or --write-mixin for teams comfortable with file changes.ide-helper.php for:
Illuminate/Support/helpers.php).composer.json scripts or CI pipelines.--dir flag or config.composer require --dev).vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider").php artisan ide-helper:generate and validate Facade autocompletion.ide-helper:models on a subset of models with --nowrite first.--write or --write-mixin for teams.include_fluent = true in config).composer.json scripts or CI/CD.ide-helper.php) simplifies updates (e.g., adding ignored models).ide-helper:generate).--verbose flag for Artisan commands.--nowrite to avoid modifying model files during regeneration.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| DB connection unavailable | Model PHPDocs fail to generate. | Use SQLite in-memory (-M flag) or skip model generation in CI. |
| Schema drift | PHPDocs reference non-existent DB columns. | Regenerate after migrations or use --reset to overwrite PHPDocs. |
| Real-time facades not exercised | Facade methods missing in helpers. | Document requirement to call facades before regeneration. |
| IDE cache corruption | Autocompletion shows stale methods. | Clear IDE caches or restart the IDE after regeneration. |
| Custom model hooks fail | Incorrect PHPDocs for custom logic. | Test hooks in isolation and document dependencies. |
| Composer script conflicts | Generation fails during update. |
Isolate to post-autoload-dump or use a separate script. |
How can I help you explore Laravel packages today?