original_string: protected function wrap($data, $with = [], $additional = [])
      {
          if ($data instanceof Collection) {
              $data = $data->all();
          }
  
          if ($this->haveDefaultWrapperAndDataIsUnwrapped($data)) {
              $data = [$this->wrapper() => $data];
          } elseif ($this->haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional)) {
              $data = [($this->wrapper() ?? 'data') => $data];
          }
  
          return array_merge_recursive($data, $with, $additional);
      }
code: protected function wrap($data, $with = [], $additional = [])
      {
          if ($data instanceof Collection) {
              $data = $data->all();
          }
  
          if ($this->haveDefaultWrapperAndDataIsUnwrapped($data)) {
              $data = [$this->wrapper() => $data];
          } elseif ($this->haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional)) {
              $data = [($this->wrapper() ?? 'data') => $data];
          }
  
          return array_merge_recursive($data, $with, $additional);
      }
code_tokens: protected function wrap ( $ data , $ with = [ ] , $ additional = [ ] ) { if ( $ data instanceof Collection ) { $ data = $ data -> all ( ) ; } if ( $ this -> haveDefaultWrapperAndDataIsUnwrapped ( $ data ) ) { $ data = [ $ this -> wrapper ( ) => $ data ] ; } elseif ( $ this -> haveAdditionalInformationAndDataIsUnwrapped ( $ data , $ with , $ additional ) ) { $ data = [ ( $ this -> wrapper ( ) ?? 'data' ) => $ data ] ; } return array_merge_recursive ( $ data , $ with , $ additional ) ; }
docstring: Wrap the given data if necessary.
  
  @param  array  $data
  @param  array  $with
  @param  array  $additional
  @return array
docstring_tokens: Wrap the given data if necessary .