public function transform($object)
    {
        if (($collection = $this->normalize($object)) instanceof Collection) {
            return $this->transformCollection($collection);
        }

        // If there are relations setup, transform it along with the object.
        if ($this->relatedCount) {
            return $this->transformWithRelated($object);
        }

        // If another transformation method was requested, use that instead.
        if (is_callable($this->transformationMethod)) {
            return $this->getAlternateTransformation($object);
        }

        return $this->getTransformation($object);
    }