Laravel Ide Helper
Laravel Ide Helper stats
- Downloads
- 64.4M
- Stars
- 13,407
- Open Issues
- 179
- Forks
- 1,134
Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
Laravel IDE Helper Generator
The Laravel IDE Helper Generator is an essential tool for enhancing your Integrated Development Environment (IDE) with powerful autocompletion and code analysis capabilities tailored for Laravel projects. This package dynamically generates helper files that keep your IDE in sync with the Laravel application’s facades, models, and other fluent methods, ensuring a smoother development workflow.
Key Features:
- Automatic PHPDoc Generation: Automatically generates PHPDocs for Laravel facades, models, and fluent methods to improve autocompletion accuracy.
- Model Support: Analyzes models based on database tables and relationships to provide detailed property and method insights directly in your IDE.
- PhpStorm Meta File: Enhances support for Laravel’s service container resolving features, offering precise method autocompletion.
- Configurable: Offers various configurations to tailor the generation process to your specific needs, such as custom directory scanning, ignoring models, and more.
- Command-Line Interface: Leverages Artisan commands to regenerate documentation and manage configurations effortlessly.
Installation
Install via Composer in your Laravel project:
composer require --dev barryvdh/laravel-ide-helper
The package utilizes Laravel's package auto-discovery, so it is not loaded in production when dev dependencies are excluded.
Usage
-
Generate Docs for Facades:
php artisan ide-helper:generate -
Generate Model Docs:
php artisan ide-helper:models -
Generate PhpStorm Meta File:
php artisan ide-helper:meta
Configuration
-
Publish the configuration file to modify settings like ignored models, directories, and custom database types:
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config -
Adjust settings directly in the published
config/ide-helper.phpfor more control over PHPDoc generation, such as disabling magicwheremethods or customizing model directories.
Notable Commands
- Regenerate Documentation: Useful for keeping the helper files in sync with your application’s evolving codebase.
- Handling Models: Offers flexibility in handling model documentation, whether appending to existing models or generating separate files.
Additional Information
- Ensure a compatible development environment with Laravel 8+ and PHP 7.3+.
- Consider clearing config cache in development to avoid potential issues after installation.
Conclusion
The Laravel IDE Helper Generator is a powerful ally in maintaining efficient and accurate code assistance within your IDE, significantly enhancing productivity and reducing potential errors by ensuring your development environment recognizes Laravel-specific structures.
For further details and an introductory tutorial, check out Laracasts.
License
This package is open-sourced software licensed under the MIT license.