I use Termux and ssh for this. Plus Zellij/tmux. Classic stuff I used to do for regular dev back 10 years ago.
My phone also can build and run many projects on its own so I often don't even connect to the laptop.