The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

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 v4.0.0 is released image

Laravel Debugbar v4.0.0 is released

Read article
Laravel Debugbar Gets a Big UI Update image

Laravel Debugbar Gets a Big UI Update

Read article
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell