[Feature Request]: Exclude specific files/paths from helper code generation
Feature Description
The issue
When generating helper code we currently get warnings for fixture classes in our test directory.
First of all the tables cannot be found as the migrations are part of the specific test setup.
Secondly, these are test fixtures and I don't need or want to be indexed by the plugin.
The request
I would like a way to exclude specific files, paths and/or patterns from being indexed.
Thank you for taking the time to share your request! I've added it into internal feature tracker.
First of all the tables cannot be found as the migrations
This warning shown only if helper generation is setup with db connection search
these are test fixtures and I don't need or want to be indexed by the plugin.
Do tests/ folder marked as test sources? We may add check to skip search in test roots
The classes are in a fixtures directory which is indeed an ancestor of a "Test Sources Root" directory (./tests/).
Hi, I'm seeing the same warning with my test models. It would be helpful to have an annotation on the model class to exclude it from helper code generation.
Hi, I'm seeing the same warning with my test models. It would be helpful to have an annotation on the model class to exclude it from helper code generation.
![]()
This is exactly our case as well. Tests with migrations in the setup of the test, which means they are not available during helper code generation.
In current release, you can create ide.json file in root of the project with following contents (adjust your class names or namespaces):
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"helperCode": {
"eloquent": {
"ignoreClasses": [],
"ignoreNamespaces": ["Tests\\Feature\\"]
}
}
}
It will ignore this models in Helper Code Generation. See if it will help for your cases. We will think of providing a way to do it through GUI settings
@gorbunov doesn't seem to work
OK, after several runs it worked, thanks.
Awesome, that worked for me. I had already looked for this in ide.json, but this workaround is currently undocumented.