ide.json: Helper Code
Overview
The helperCode section controls how Laravel Idea generates its internal helper code — the phantom PHP file that gives the IDE type information for dynamic Laravel patterns.
helperCode.eloquent
Controls which Eloquent models are included in helper code generation.
eloquent.ignoreClasses
A list of fully qualified class names that should be excluded from Eloquent helper code generation.
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"helperCode": {
"eloquent": {
"ignoreClasses": [
"\\MyPackage\\BaseModel",
"\\MyPackage\\TenantModel"
]
}
}
}eloquent.ignoreNamespaces
A list of PHP namespaces. All Eloquent models inside these namespaces will be excluded from helper code generation.
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"helperCode": {
"eloquent": {
"ignoreNamespaces": [
"\\MyPackage\\Models"
]
}
}
}helperCode.methodsWithConstructorParameters
Registers methods that accept the same parameters as a class constructor. This is the pattern used by dispatch(), Bus::dispatch(), and similar helpers — the method's signature mirrors the constructor of the class passed as an argument.
Laravel Idea will expose those constructor parameters as if they were the method's own parameters, enabling proper type-checking and completion.
| Field | Required | Description |
|---|---|---|
baseFqn | Yes | FQN of the base class/interface/trait whose inherit class methods should be enhanced. |
methods | Yes | Array of method definitions. |
Each method:
| Field | Required | Description |
|---|---|---|
name | Yes | Method name. |
returnType | Yes | FQN of the return type. |
additionalParameters | No | Extra parameters added before the constructor parameters. |
Each additional parameter:
| Field | Required | Description |
|---|---|---|
name | Yes | Parameter name. |
type | Yes | PHP type (FQN or primitive). |
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"helperCode": {
"methodsWithConstructorParameters": [
{
"baseFqn": "\\MyPackage\\Bus",
"methods": [
{
"name": "dispatch",
"returnType": "\\MyPackage\\PendingDispatch"
},
{
"name": "dispatchAfterResponse",
"returnType": "\\MyPackage\\PendingDispatch",
"additionalParameters": [
{ "name": "delay", "type": "int" }
]
}
]
}
]
}
}For this example, if the class is extended from the \MyPackage\Bus class and has a constructor __construct(string $name), two methods will be generated in the helper code: dispatch(string $name) and dispatchAfterResponse(int $delay, string $name).
helperCode.classMixins
Adds a @mixin annotation to a class in the helper code, giving it all the methods and properties from another class. Useful when a package dynamically extends a class via macros or traits that the IDE cannot detect statically.
| Field | Required | Description |
|---|---|---|
classFqn | Yes | FQN of the class to receive the mixin. |
mixinFqn | Yes | FQN of the class whose members are mixed in. |
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"helperCode": {
"classMixins": [
{
"classFqn": "\\Illuminate\\Http\\Request",
"mixinFqn": "\\MyPackage\\RequestMacros"
}
]
}
}After this, all public methods and properties from \MyPackage\RequestMacros will be available on \Illuminate\Http\Request in the IDE.