Todd Muller has resigned as the National Party leader.