With the optocoupler, you likely don't need Q7.
Just connect the opto output emitter (pin 3) to ground and the collector (pin 4) to M1's gate (with R1 of course).
But depending upon the gain the of opto, you may need to reduce the value of R2 or increase the value of R1, to fully saturate the...