SOLVED: Relation names are case sensitive.

Hi all, I’m in the process of adding an additional selection option to view product inventory. I’ve successfully used other categories as selection methods. I’m now running into the following error:

Invalid Parameter – yii\base\InvalidParamException

Relation names are case sensitive. common\models\Products has a relation named "inventory" instead of "Inventory".

The code from the Products Model:

public function getInventory()


     return $this->hasMany(Inventory::className(),['inventory_id' => 'inventory_id']);


I’ve done searches that are case sensitive and do not see the discrepancy. Any light shed on this would be greatly appreciated.


How do you call for this relation - ->inventory or ->Inventory?

->joinWith([‘power’, ‘categories’,‘Inventory’]);

solution: ->joinWith([‘power’, ‘categories’,‘inventory’]);

Thanks Bizley. Great Question. On to the next message. :)