Donald Trump forged a remarkable ceasefire deal between Hamas and Israel after both parties ran out of options.