/** * Get item informations for rendering item_informations. * * @return void */ public function getItemInformations() { global $data; global $settings; // get target item informations $this->getTargetItemInformations(); $array = array(); foreach ($settings['item_informations'] as $code => $item_informations) { $array[$code] = ItemInformation::whereIn('code', $item_informations)->get()->toArray(); $arraySecond = array(); foreach ($array[$code] as $key => $row) { $row['settings'] = json_decode($row['settings'], true); $arraySecond[$row['code']] = $row; } $array[$code] = $arraySecond; } $data['item_informations'] = $array; }