invoice()->invoice_items as $item) { $details[$item->product_key] = $item->notes; } $data['language'] = $locale; $data['details'] = $details; return $data; } }