The court may order a party to pay a reasonable amount to the other party for attorney’s fees incurred prior to the commencement of the proceeding, throughout the proceeding, and after entry of judgment. The court shall consider all relevant factors, including the financial resources of both parties, and may order that the amount be paid directly to the attorney, who may enforce the order in his name.