Laravel + PhpStorm: is it possible jump to function from routes definition in one step?

时间秒杀一切 提交于 2021-02-10 04:13:50

问题


We have quite a lot routes, such as:

Route::get('/','WebController@index');

When I want to jump to function, I have to:

  1. go to the class WebController
  2. go to the function index()

Is it possible jump to function from routes definition in one step?


回答1:


You should have to install plugin for laravel in php strom. - Under Settings (Preferences) | Plugins, click the Browse repositories... button and search for Laravel. Next, we can use the Install plugin button or the context menu to proceed with plugin installation. Restart the IDE to complete the installation of the plugins. Next, we will have to enable the Laravel Plugin in our project. We can do this from Settings (Preferences) | Other Settings | Laravel Plugin | Enable Plugin for this Project. We'll have to restart the IDE once more to load the plugin's additional features for Laravel. Refrence: https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm




回答2:


  1. Install Laravel Plugin for PHPstorm (Settings -> Plugins -> Laravel)
  2. Active it per Project (Settings > Languages & Frameworks > PHP > Laravel)
  3. Use "Laravel IDE Helper Generator": https://github.com/barryvdh/laravel-ide-helper


来源:https://stackoverflow.com/questions/49645290/laravel-phpstorm-is-it-possible-jump-to-function-from-routes-definition-in-on

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!