$files->toJson()

Converts the collection to a json string.