adelf / idea-php-dotenv-plugin

environment parameters completion, based on .env file keys
MIT License
166 stars 13 forks source link

Unable To Use "HasFactories" with Factories Under Subfolders #112

Closed megahash closed 1 year ago

megahash commented 1 year ago

When adding "HasFactory" to a model, where the factory is in the root folder (database/factories), no issues are raised by PhpStorm. However, if you have a factory that is in a subfolder, let's say (database/factories/test), an alert is raised (Can't find the factory class).

When I disable the plugin, I don't receive the error notification. I have a paid subscription to your plugin. Issue with HasFactory

adelf commented 1 year ago

Hi. Seems, you've chosen wrong repository to create issue)

Anyway, does this work in Laravel? Without $model = Role::class; in the factory class?

adelf commented 1 year ago

Also, if you have another factory fetching strategy in your app you can press Alt-Enter and Disable it for the whole project.

image
megahash commented 1 year ago

@adelf Thank you for the help. I added $model = Role::class; and the highlighted issue went away. I love the plugin!