What is the main “moral “ of Candide and how is it revealed?

What is the main “moral “ of Candide and how is it revealed?  One satirical theme of Candide is that Optimist philosophy, the belief that we live in “the best of all possible worlds,” is a foolish response to cruel  unjust behavior by individuals and institutions.  How does the novel criticize Optimism by mocking Pangloss, even in the late chapters?  Does Martin have a better response to cruelty and injustice?  Is a positive theme suggested by the ending–the Turk and Candide’s “we must cultivate our garden” and the life Candide and friends lead in Turkey? Or does Voltaire or his narrator suggest a different moral?