I came across a method called GeyRaysFromPointToPolygon. As I explored how this method works (my exploration is documented here, if you are interested), I realised the sheer diversity of methods relating to 2D raycasting that Phaser 3 provides. The below example uses Phaser.Geom.Intersects.GetLineToPolygon method.
The example code is available in the Codepen below.
I then went onto find out about Phaser 3’s functionality for 2D raycasting in tilemaps. Among my various experiments (documented here), I implemented a method to reduce the number of polygons that the intersect method checks against.