A rough starting point could be something like this:
Player overlaps wall
X player overlaps wall at offset (0,-1)
— set onGround to true
Other ideas could be to sample points below the player for overlaps, or position other sprites around the player for overlap checks, or checking the length of a ray cast below the player, or maybe checking the physics contacts and see if any of them are roughly pointing up. The platform behavior detects of the player is on the ground at the same time as it pushes the object out of walls vertically, but with physics you’ll have to resort to one of the other ideas.
There are probably other approaches too.