You can't fight Hamas in Gaza with just tanks and planes either. For so so many reasons. Anoyone who thinks so simply doesn't understand warfare, let alone urban warfare with lots of tunnels.
Which is where a lot of the criticism over the woke IDF command goes.
Why put IDF soldiers in harms way.
Total blockade (as in no electricity, fuel, water, food, and a stern warning to the Egyptians to enforce it from their end, along with aerial bombing to raze anything along the perimeter border), and bombing any place where rockets are fired from.