public function items(): HasMany
{
return $this->hasMany(InventoryItem::class);
}
public function rootItems(): HasMany
{
return $this->items()->whereNull('inventory_group_id');
}
Expected Behavior
The extension should recognize that chaining builder methods (like where(), whereNull(), orderBy()) on a Relation object returns the Relation object, not the Builder.
Environment