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.
Auth::, Cache::) and Eloquent models, reducing runtime errors from incorrect method calls.@property, @method) that can power future AI code completion or static analysis tools.Adopt if:
Auth, Cache) or Eloquent models heavily.node_modules in dev dependencies).Look elsewhere if:
"This package cuts developer onboarding time by 30% by auto-generating IDE-friendly PHPDocs for Laravel’s Facades and models. For example, a new hire can instantly see all available Auth:: methods without manual setup. It’s a $0 cost (MIT license) with a 5-minute setup, and it future-proofs our codebase for AI tools. Teams using Facades or Eloquent will see immediate productivity gains—no more guessing method names or waiting for IDE indexes to rebuild."
*"Leverage barryvdh/laravel-ide-helper to:
Auth::methodDoesNotExist() errors—IDE autocompletion covers all Facade methods.@property and @method tags for Eloquent models (including relations) in one command, reducing manual PHPDoc drudgery.ide-helper:generate to post-update-cmd in composer.json to keep docs in sync with dependencies.Route::) get IDE support.Tradeoff: Adds ~5MB to dev dependencies and requires a DB connection for model docs. Worth it for teams with >5 Laravel devs."*
*"Stop writing boring PHPDocs! Run:
composer require barryvdh/laravel-ide-helper
php artisan ide-helper:generate # For Facades
php artisan ide-helper:models -RW # For models (overwrites docs)
Now your IDE will autocomplete:
Auth::attempt(), Cache::get()).$user->posts, $post->author_id).$table->string()->nullable() in migrations).Pro tip: Add to composer.json to auto-run on updates:
"scripts": {
"post-update-cmd": [
"@php artisan ide-helper:generate"
]
}
```"*
How can I help you explore Laravel packages today?