laravel門面類的代碼提示方案:
https://github.com/barryvdh/laravel-ide-helper
按照步驟安裝
1、composer require barryvdh/laravel-ide-helper
2、添加下面這行到config\app.PHP的providers數組項中
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
3、php artisan ide-helper:generate
這時候報錯
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "ide-helper" namespace.
php artisan clear-compiled
php artisan optimize
都沒用
最后是運行
php artisan config:clear
再執行php artisan ide-helper:generate就成功了 如果執行php artisan ide-helper:generate 報遠程拒絕訪問 是因為你的mysql服務沒有開啟 開啟后 在執行這個命令即可