code: private function getShippingAddressData(array $entry)
      {
          $shippingAddress = array_filter($entry['addresses'], function (array $address) {
              return $address['pivot']['typeId'] === 2;
          });
  
          if (empty($shippingAddress)) {
              return [];
          }
  
          return array_shift($shippingAddress);
      }
docs: @param array $entry
  
  @return array