idea-php-laravel-plugin icon indicating copy to clipboard operation
idea-php-laravel-plugin copied to clipboard

navigating from route to controller not working

Open SilvaQ opened this issue 6 years ago • 21 comments

In the latest version of PHPstorm 2019.1, the route in web.php that can locate and jump to a controller for a while suddenly becomes unusable again. Failure indicates that the class was not found. Reinstalling the plugin and restarting phpstorm will work again, but it will fail again after a while. I have no choice but to lower the version of Phpstorm. Now it is the version of 2018.3, and it works normally in this version. I hope this problem can be solved soon.

Environmental information in case of problems:

  • MacOS mojave 10.14.4
  • laravel 5.5 lts
  • php7.3

SilvaQ avatar Apr 02 '19 10:04 SilvaQ

I'm having the same problem after updating PHPStorm to 2019.1. Code completion works, but code navigation does not.

Screen recording

Screen Recording 2019-04-03 at 11 58 08 AM

Environment

macOS 10.14.4 PhpStorm 2019.1 Laravel Plugin v0.15.2 Laravel 5.8

sblomberg avatar Apr 03 '19 17:04 sblomberg

It appears this issue was closed due to the workaround found here: https://github.com/barryvdh/laravel-ide-helper/issues/708#issuecomment-484984972

sblomberg avatar May 13 '19 08:05 sblomberg

It started to go wrong again, sometimes it worked, sometimes it didn't.

Restart a few times inexplicably began to work again。


Laravel Framework 5.5.45

"barryvdh/laravel-ide-helper": "^2.4",

PHP 7.2.13 (cli) (built: Dec 7 2018 10:41:23) ( NTS ) PhpStorm 2019.1.2 Build #PS-191.7141.52, built on May 8, 2019 JRE: 1.8.0_202-release-1483-b49 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.4

SilvaQ avatar May 20 '19 03:05 SilvaQ

它又开始出错了,有时它会起作用,有时则没有。

重启几次莫名其妙地再次开始工作。

Laravel Framework 5.5.45

“barryvdh / laravel-ide-helper”:“^ 2.4”,

PHP 7.2.13(cli)(建于:2018年12月7日10:41:23)(NTS) PhpStorm 2019.1.2 Build#PS-191.7141.52,建于2019年5月8日 JRE:1.8.0_202-release-1483- b49 x86_64 JVM:JetBrains的OpenJDK 64位服务器虚拟机sro macOS 10.14.4

me too

laravel 5.7 laravel-ide-helper 2.6.2

klgd avatar May 21 '19 03:05 klgd

After the v0.15.4 update of this idea-php-laravel-plugin broke my code navigation functionality again, this is what got it working again for me:

  1. In the project root, delete _ide_helper.php
  2. Run php artisan ide-helper:generate to create a fresh new _ide_helper.php
  3. Open project Preferences dialog, then go to Languages & Frameworks -> PHP -> Laravel
  4. Uncheck "Enable plugin for this project" and click Apply
  5. Check "Enable plugin for this project" and click Apply
  6. Close Preferences dialog, code navigation now working as expected again

sblomberg avatar Jun 04 '19 15:06 sblomberg

@sblomberg I did the same thing and it worked.

Sometimes it just doesn't work out.

Sometimes re-opening will fail.

Sometimes when a new window opens on another project, both items fail.

When multiple Windows open a new item, one failure transient causes another failure.

SilvaQ avatar Jun 05 '19 02:06 SilvaQ

Same issue here. Work-around ( removing IDE-helper file) didn't work. Anything else worth trying ?

fvrdam avatar Jul 12 '19 11:07 fvrdam

Same issue here. Work-around ( removing IDE-helper file) didn't work. Anything else worth trying ?

@fvrdam I have given up the new version and returned to 2018.3

SilvaQ avatar Jul 13 '19 03:07 SilvaQ

Same issue here Phpstorm 2019.2

rahacker2006 avatar Jul 27 '19 17:07 rahacker2006

Me too. And all of my controller methods report as unused. I don't know if this is a plugin or PHPStorm issue, but every iteration of PHPStorm costs more and delivers less.

kvn1234 avatar Aug 28 '19 21:08 kvn1234

Same issue with 2019.2. Now my functions in Controller display as "Unused element". I have tired re-enable the Laravel plugin, Symphony plugin, and cleared cache, cleared compiled and regenerate the ide helper.

unizhu avatar Sep 06 '19 09:09 unizhu

I've also had this issue, I think since the first 2019 release.

Reverting to 2018.3 fixes it immediately and allows navigation from Route to Controller.

anugupta avatar Sep 24 '19 08:09 anugupta

Any updates on this? Having exactly the same problem.

KrisOzolins avatar Nov 28 '19 11:11 KrisOzolins

@sblomberg it's 2019.3 and problem's still there. But your solution works. Thank you. o/

TimurShaidulin avatar Nov 30 '19 00:11 TimurShaidulin

I have the same issue and none of the solutions worked.

esmatullaharifi avatar Feb 05 '20 02:02 esmatullaharifi

Late to the party but when I had this issue, I used invaldiate caches and restart and that fixed it for me. This was for 2020.1

engma avatar Apr 18 '20 11:04 engma

To be clear, PHPSTORM File | Invalidate Caches / Restart is meant.

fjf2002 avatar Jun 15 '20 16:06 fjf2002

You need to get the Laravel Idea Plugin paid version to enable that. Here is the link for it.

https://plugins.jetbrains.com/plugin/13441-laravel-idea

NB: You can also try it for free for 30 days before purchasing

mkombeogo avatar Jun 28 '20 12:06 mkombeogo

You need to get the Laravel Idea Plugin paid version to enable that. Here is the link for it.

https://plugins.jetbrains.com/plugin/13441-laravel-idea

NB: You can also try it for free for 30 days before purchasing

I'm using the free Laravel Plugin with PHPStorm 2020.1 and it works, but sometimes you need to do some "maintenance" as invalidate caches, enable and disable de plugin, regenerate de ide helper, etc.

aleangelico avatar Jun 29 '20 14:06 aleangelico

Before finding this branch I thought that this problem is unique to my setup / environment. Same problem. Sometimes randomly stops /start working.

noreff avatar Jul 17 '20 20:07 noreff

I am having this issue on PhpStorm 2021.3.2 Cannot click through to the controllers from the Routes file. I have tried all the solutions including the paid plugin. I have found that adding the code below allowed it to work.

/** @routeNamespace("App\Http\Controllers") */

MacBook air bigSur Laravel 9

Shane-McCarthy avatar Feb 18 '22 20:02 Shane-McCarthy