parseCustomFields($data['custom_fields']); $company->fill($data); $company->save(); return $company; } private function parseCustomFields($fields) :array { foreach($fields as &$value) { $value = (string)$value; } return $fields; } }