Open HenriqueSPin opened 2 years ago
When we "extend# an existing relationship, ide-helper seems to ignore this new relationship.
Let's say we have a relationship like:
public function allocatedAssets(): HasManyThrough|AllocatedAsset { return $this->hasManyThrough( AllocatedAsset::class, Allocation::class, ); }
We want to get only the "open" ones (some filter on the existing relationship):
public function openAllocatedAssets(): HasManyThrough|AllocatedAsset { return $this->allocatedAssets() ->where(fn($query) => $query->whereNull('arrived_at')->where('will_not_arrive', false)); }
The above code will not generate the expected docblock lines:
/** * @property-read Collection|AllocatedAsset[] $openAllocatedAssets * @property-read int|null $open_allocated_assets_count */
This way it works:
public function openAllocatedAssets(): HasManyThrough|AllocatedAsset { return $this->hasManyThrough( AllocatedAsset::class, Allocation::class, ) ->where(fn($query) => $query->whereNull('arrived_at')->where('will_not_arrive', false)); }
Versions:
Description:
When we "extend# an existing relationship, ide-helper seems to ignore this new relationship.
Let's say we have a relationship like:
We want to get only the "open" ones (some filter on the existing relationship):
The above code will not generate the expected docblock lines:
This way it works: