public static function toArray($object)
	{
		if(is_array($object))
			return $object;
		elseif(!is_object($object))
			return (array) $object;
		elseif ($object instanceof IlluminateCollection)
			return $object->all();
		elseif ($object instanceof IlluminateArrayable)
			return $object->toArray();
		elseif(method_exists($object, '__toString'))
			return [$object];
		elseif ($object instanceof IlluminateJsonable)
			return (array) json_decode($object->toJson(), true);
		elseif ($object instanceof JsonSerializable)
			return (array) $object->jsonSerialize();
		elseif ($object instanceof Traversable)
			return iterator_to_array($object);
		else
			return (array) $object;
	}
public static function toArray($object)
	{
		if(is_array($object))
			return $object;
		elseif(!is_object($object))
			return (array) $object;
		elseif ($object instanceof IlluminateCollection)
			return $object->all();
		elseif ($object instanceof IlluminateArrayable)
			return $object->toArray();
		elseif(method_exists($object, '__toString'))
			return [$object];
		elseif ($object instanceof IlluminateJsonable)
			return (array) json_decode($object->toJson(), true);
		elseif ($object instanceof JsonSerializable)
			return (array) $object->jsonSerialize();
		elseif ($object instanceof Traversable)
			return iterator_to_array($object);
		else
			return (array) $object;
	}
public static function toArray ( $ object ) { if ( is_array ( $ object ) ) return $ object ; elseif ( ! is_object ( $ object ) ) return ( array ) $ object ; elseif ( $ object instanceof IlluminateCollection ) return $ object -> all ( ) ; elseif ( $ object instanceof IlluminateArrayable ) return $ object -> toArray ( ) ; elseif ( method_exists ( $ object , '__toString' ) ) return [ $ object ] ; elseif ( $ object instanceof IlluminateJsonable ) return ( array ) json_decode ( $ object -> toJson ( ) , true ) ; elseif ( $ object instanceof JsonSerializable ) return ( array ) $ object -> jsonSerialize ( ) ; elseif ( $ object instanceof Traversable ) return iterator_to_array ( $ object ) ; else return ( array ) $ object ; }
Cast the given object to an array

@param  mixed  $object
@return array
Cast the given object to an array