original_string: public function transform()
      {
          $object = $this->resource;
  
          $data = $object instanceof Collection || $object instanceof AbstractPaginator
              ? $object->map([$this, 'transformResource'])->toArray()
              : $this->transformResource($object);
  
          if ($object instanceof AbstractPaginator) {
              $this->withMeta(array_merge(
                  $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])
              ));
          }
  
          $data = array_filter(compact('data') + $this->extras);
          ksort($data);
  
          return $data;
      }
code: public function transform()
      {
          $object = $this->resource;
  
          $data = $object instanceof Collection || $object instanceof AbstractPaginator
              ? $object->map([$this, 'transformResource'])->toArray()
              : $this->transformResource($object);
  
          if ($object instanceof AbstractPaginator) {
              $this->withMeta(array_merge(
                  $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])
              ));
          }
  
          $data = array_filter(compact('data') + $this->extras);
          ksort($data);
  
          return $data;
      }
code_tokens: public function transform ( ) { $ object = $ this -> resource ; $ data = $ object instanceof Collection || $ object instanceof AbstractPaginator ? $ object -> map ( [ $ this , 'transformResource' ] ) -> toArray ( ) : $ this -> transformResource ( $ object ) ; if ( $ object instanceof AbstractPaginator ) { $ this -> withMeta ( array_merge ( $ this -> getExtra ( 'meta' , [ ] ) , Arr :: except ( $ object -> toArray ( ) , [ 'data' ] ) ) ) ; } $ data = array_filter ( compact ( 'data' ) + $ this -> extras ) ; ksort ( $ data ) ; return $ data ; }
docstring: Get a displayable API output for the given object.
  
  @return array
docstring_tokens: Get a displayable API output for the given object .