Search code examples
phpstorm

How in PhpStorm 2021 to move into factory declarations?


Working with laravel 9 site in PhpStorm 2021 I having line with factory :

\App\Models\Item::factory(Item::class)->make([
...

I would like to open content of database/factories/ItemFactory.php file, but

With selection Right popup menu=> Go to =>Implementations I have _ide_helper_models.php file (I have barryvdh/laravel-ide-helper: ^2.12 installed) opened with code :

* @method static \Database\Factories\ItemFactory factory(...$parameters)
...

If there is a way to move to ItemFactory.php ?

Thanks in advance!


Solution

  • Not via Ctrl+Click or Go to | Implementations, unfortunately: https://github.com/barryvdh/laravel-ide-helper/issues/1209#issuecomment-815754610

    You can perhaps invoke Navigate > Class and paste there ItemFactory - that should show you 2 ItemFactory classes, one in the helper file, and one that you're looking for.