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;
    }
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;
    }
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 ; }
Get a displayable API output for the given object.

@return array
Get a displayable API output for the given object .