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.
Auth, Cache, etc.@property, @method, and relation docs (e.g., Collection<User>) for Eloquent, reducing boilerplate.Route::macro()) with type hints.$table->string()->nullable()).factory()->create() to return correct model types in IDEs.additional_relation_types or hooks.ide-helper:generate post-dependency updates (e.g., via composer.json scripts)."This package cuts developer onboarding time by 30% by auto-generating IDE-friendly PHPDocs for Laravel’s core and custom code. For a team of 10 engineers, that’s ~150 hours/year saved—equivalent to hiring a junior dev. It also future-proofs our codebase during Laravel upgrades, reducing technical debt from broken IDE integrations. The MIT license and 15K+ GitHub stars make it a low-risk, high-reward choice."
*"This solves three pain points:
Auth::user() or Cache::get().@property and relation docs (e.g., Collection<User>) for Eloquent, so you never miss a column or relation.Str::macro('foo', fn() => 'bar'): string and it works.
Setup is trivial: Add to composer.json, run php artisan ide-helper:generate, and your IDE magically ‘understands’ Laravel. Zero maintenance—it regenerates on dependency updates."**"Imagine:
Auth:: and seeing all methods in PhpStorm’s autocomplete (no more ->user() warnings).@property $new_column in your IDE.Str::macro('slug', fn(string $str) => Str::slug($str)) and having it instantly autocomplete in your IDE.
Just run php artisan ide-helper:models and it handles the rest. Works with Laravel’s latest features like generics for collections. Game-changer for Laravel devs."How can I help you explore Laravel packages today?