Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Ide Helper

Laravel Ide Helper Laravel Package

barryvdh/laravel-ide-helper

Generates accurate PHPDoc helper files for Laravel to improve IDE autocompletion and type hints. Create _ide_helper.php for facades, add or export model PHPDocs, fluent methods, factory builders, and PhpStorm container metadata—kept in sync with your project.

View on GitHub
Deep Wiki
Context7

IDE Helper for Laravel

Frequently asked questions about Laravel Ide Helper
How do I install laravel-ide-helper for Laravel 10+?
Run `composer require --dev barryvdh/laravel-ide-helper` to install the package. The 3.x branch is explicitly designed for Laravel 10+ and supports modern features like generics annotations. No additional configuration is required for basic usage.
Will this package slow down my production environment?
No, the package is installed as a dev dependency and generates static PHPDoc helper files (`_ide_helper.php`). These files are read-only at runtime and have zero impact on performance. Only IDEs use them for autocompletion.
Can I use this with VS Code instead of PhpStorm?
Yes, while optimized for PhpStorm, the generated PHPDocs are standard-compliant and work with VS Code (with extensions like IntelliSense or CodeComplice). The autocompletion for Facades, Eloquent, and Fluent methods will function identically.
How do I generate PHPDocs for Eloquent models without modifying their files?
Use the `--nowrite` flag with `php artisan ide-helper:models`. This creates a separate `_ide_helper_models.php` file instead of editing your model files directly. Example: `php artisan ide-helper:models --nowrite`.
Does this support custom Eloquent relationships or complex facades?
Yes, the package supports custom relationships via model hooks and config overrides. For complex facades, use the `--reset` flag to regenerate PHPDocs after adding new methods. Consult the [customization docs](https://github.com/barryvdh/laravel-ide-helper#model-hooks) for advanced use cases.
How can I integrate this into my CI/CD pipeline?
Add the generation commands to your `composer.json` scripts under `post-update-cmd` for automatic execution. For CI environments, use the `-M` flag to specify SQLite or mock the database connection if needed. Example: `php artisan ide-helper:models -M sqlite`.
What’s the difference between `--write` and `--write-mixin`?
`--write` directly embeds PHPDocs into your model files, while `--write-mixin` generates a separate `_ide_helper_models.php` file with `@mixin` annotations. Use `--write-mixin` to avoid cluttering model files and improve IDE performance for large projects.
Can I exclude specific models or directories from PHPDoc generation?
Yes, use the `--ignore` flag to exclude models or directories. For example, `php artisan ide-helper:models --ignore=App/Models/Archived*`. This is useful for ignoring legacy or third-party models.
How do I handle conflicts if I manually edited PHPDocs in my models?
Use `--reset` to overwrite existing PHPDocs with auto-generated ones. For partial conflicts, manually edit the generated `_ide_helper_models.php` file (if using `--nowrite`) or use `--write-mixin` to separate concerns.
Are there alternatives to this package for Laravel IDE autocompletion?
Alternatives include `nWidart/laravel-models` (model-specific) or `barryvdh/laravel-debugbar` (for debugging). However, `laravel-ide-helper` is the most comprehensive solution, covering Facades, Eloquent, Fluent methods, and container bindings in a single package. For minimal setups, consider `drefi/laravel-ide-helper` (a fork with additional features).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai