PhpStrom 使用ide-helper 快速便捷實現Laravel 框架代碼智能提示

首先,安裝phpstorm插件laravel

然後安裝composer支持並自動完成提示生成 

如果只想在開發環境安裝請加上 --dev

composer require barryvdh/laravel-ide-helper

php artisan ide-helper:eloquent

php artisan ide-helper:generate  //爲 Facades 生成註釋

php artisan ide-helper:meta     //生成 PhpStorm Meta file

php artisan ide-helper:models   //爲數據模型生成註釋


爲所有模型生成註釋 php artisan ide-helper:models, 這時會出現詢問:
Do you want to overwrite the existing model files? Choose no to write to _ide_helper_models.php instead? (Yes/No):  (yes/no) [no]:

輸入 yes 則會直接在模型文件中寫入註釋,否則會生成「_ide_helper_models.php」文件。建議選擇 yes,這樣在跟蹤文件的時候不會跳轉到「_ide_helper_models.php」文件,不過這麼做最好對模型文件做個備份,至少在生成註釋之前用 git 控制一下版本,以防萬一。 爲防止model被覆蓋,則選擇默認的 no


composer require doctrine/dbal   //migration管理數據庫文件支持修改需要引入此類
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章