public function resourceWith($entity, $transformer, $key = null): TransformationFactory
	{
		// if collection, paginator, or array with first value being an array use collection resource.
		if ((is_array($entity) && isset($entity[0]) && is_array($entity[0])) || $entity instanceof LaravelCollection || $entity instanceof LengthAwarePaginator) {
			return $this->collectionWith($entity, $transformer, $key);
		}

		return $this->itemWith($entity, $transformer, $key);
	}