code: public function transformCollection($collection)
  	{
  		if(is_object($collection))
  			$collection = $collection->toArray()["data"];
  
  		return array_map([$this , "transform"], $collection);
  	}
docs: Iterates whether a collection or an
  array to the transform method.
  
  @param array|collection $collection
  @return array