jamesil/nova-google-polygon
A Laravel Nova field for drawing and editing polygons on Google Maps, storing polygon coordinates or GeoJSON in your models. Adds an interactive map input to Nova forms for location-based data.
Polygon::contain() test, so “is this address/GPS point inside this zone?” becomes a plain application-level check. That directly supports decisions like should we accept this delivery order, which sales territory owns this lead, or is this signup inside our service area.ext-bcmath requirement removes a hard dependency from container images, managed runtimes, and shared hosting — less ops surface for the same functionality, with no code changes on our side.Adopt when:
2.x line; 1.2.1 for the 1.x line) and want admins to draw/edit polygons in the Nova UI.Look elsewhere when:
false instead of throwing. That is a good defensive default, but it converts bad geometry into silent false negatives — you need upstream validation and monitoring, or you will under-serve customers without an error to alert you.For executives (one line): This package lets operations staff draw service areas on a map and lets the product reliably answer “is this customer inside?” — without adding a spatial database or a GIS vendor. This release is a correctness and simplification fix: boundary, meridian, and equator cases that previously returned wrong answers or crashed now match an exact reference across 8M+ comparisons, a required PHP extension was removed, and there is no API change — so it is a low-risk upgrade we should take promptly.
For engineering: Patch-level composer update, no code changes. Fixes Polygon::contain() ray casting for shared-longitude vertices and near-equator coordinates (the old scientific-notation/bccomp path), replaces throws on empty or sub-three-vertex polygons with false, documents the half-open edge convention, and drops ext-bcmath. Two follow-ups worth doing: (1) audit any workarounds added for the equator ValueError and delete them; (2) add boundary-point regression tests, since correct behaviour now differs from the old buggy behaviour for existing stored polygons.
Risk framing: The previous defect was silent wrong answers at boundaries, not loud failures — which is why the fix matters beyond a version bump. The new behaviour is deterministic and documented, so containment results become something we can put in front of customers and auditors.
How can I help you explore Laravel packages today?