jonah
(Poppitypop)
1
not sure if it’s a bug but or just me so I’m posting it here first
item has a many_many relationship with order
item belongs_to lead
$order->items(array(‘with’=>‘lead’)) //works
$order->with(‘items’)->items //does not work
The latter throws an error: Relation "item" is not defined in active record class "Order".
Y11
(Y!!)
2
I don’t understand. Are you trying to access items data? Then why not do:
foreach ($order->items as $item) {
...
jonah
(Poppitypop)
3
Yes, but I want the leads to be eagerly loaded. As stated in the topic, an item has_many leads