In part 3 of this comprehensive tutorial series it covers handling input and game logic.
Crazy Games has published a new multi-part tutorial series on creating the game Sokoban in Phaser 3:
"In this episode we will handle keyboard and touch input to move our player through the world. We will add the game logic that checks for valid moves and that verifies whether the win condition was met.
We want to add two kinds of input: keyboard input for desktop users, and touch input for mobile users.
We will start with keyboard input."