Trump wrote on his social media platform that he would be appealing the case and was confident he would prevail.