Tinkerwell - The PHP Scratchpad

Laravel Ide Helper

barryvdh/laravel-ide-helper image

Laravel Ide Helper stats

Downloads
64.4M
Stars
13,407
Open Issues
179
Forks
1,134

View on GitHub →

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

  1. Generate Docs for Facades:

    php artisan ide-helper:generate
  2. Generate Model Docs:

    php artisan ide-helper:models
  3. 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.php for more control over PHPDoc generation, such as disabling magic where methods 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.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Barryvdh Laravel Ide Helper Related Articles

Laravel Debugbar Gets a Big UI Update image

Laravel Debugbar Gets a Big UI Update

Read article
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit