The Israeli cabinet has approved a ceasefire and prisoner exchange agreement with Hamas, marking a pivotal step towards peace in Gaza.