Home >PHP Framework >Laravel >How to quickly install the IDE prompt tool of the laravel framework

How to quickly install the IDE prompt tool of the laravel framework

藏色散人
藏色散人forward
2021-03-09 13:38:472761browse

The following tutorial column will introduce you to the IDE prompt tool for quickly installing the laravel framework. I hope it will be helpful to friends who need it!

Quickly install IDE prompt tool for laravel framework

Use this package with composer using the following command:

composer require –dev barryvdh/laravel-ide-helper

After updating composer, add the service provider to config/app.php
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class
  • In Laravel, instead of adding the service provider in the configuration/application.php file, you can add the following code Go to the application/providers/AppServiceProvider.php file, in the register() method:
    public function register(){if ($this->app->environment() !== 'production') {
        $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);}}
  • You can configure composer.json to do this after every commit:
    "scripts":{"post-update-cmd": [
        "Illuminate\Foundation\ComposerScripts::postUpdate",        "@php artisan ide-helper:generate",        "@php artisan ide-helper:meta"]},
  • You can also publish configuration files to change the implementation (i.e. the interface of a specific class) or set the default values ​​for -helpers or -sublime.
    php artisan vendor:publish –provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" –tag=config
  • Now you can regenerate the documentation yourself (for future updates)
    php artisan ide-helper:generate
Recommended:
The latest five Laravel videos Tutorial

The above is the detailed content of How to quickly install the IDE prompt tool of the laravel framework. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete