当前位置: 首页 > 工具软件 > Dev-PHP IDE > 使用案例 >

laravel代码提示:laravel-ide-helper

澹台昆
2023-12-01

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

安装

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

设置服务提供者

config/app.php:

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,

5.5及以上版本不需要设置

设置只在开发环境中加载

app/Providers/AppServiceProvider.php:

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

设置自动更新

conposer.json:

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

发布配置文件

php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config

设置链式调用支持、为函数生成帮助文件

config/ide-helper.php:

'include_fluent' => true,

'include_helpers' => true,

 

 类似资料: