- 打開 phpstrorm plugins 搜索 Laravel 安裝
- Setting -> Language-> php -> Laravel 勾選上
- 使用composer安裝插件
require barryvdh/laravel-ide-helper
- 打開 laravel項目 config -> app.php 找到 provide 添加這行代碼
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
- 打開laravel項目 app-> Providers -> AppServiceProvider boot 中添加 下邊代碼
if ($this->app->environment() !== 'production'){
$this->app->register(\barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
- 在 larave 項目中打開命令行 輸入
php artisan ide-helper:gener
提示 A new helper file was written to _ide_helper.php 表示成功