laravel-ide-helper

Original document:

https://github.com/barryvdh/laravel-ide-helper

Installion

composer require barryvdh/laravel-ide-helper [--dev]

Add Service

Add the service provider to the providers array in config/app.php

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,

or add the following code to your app/Providers/AppServiceProvider.php file, within the register() method:

public function register()
{
    if ($this->app->environment() !== 'production') {
        $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
    }
    // ...
}

Commands

php artisan ide-helper:generate
# create phpDoc for auto complete

php artisan ide-helper:meta
# PhpStorm Meta for Container instances

NOTICE: If you need regenerate phpDoc, you must clear the old files by run php artisan clear-compiled and php artisan optimize

To make it easier to use, you can also add a script in composer.json:

"scripts":{
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan ide-helper:generate",
        "php artisan ide-helper:meta",
        "php artisan optimize"
    ]
},

results matching ""

    No results matching ""