- What is wm/map-multi-polygon and what does it actually do?
- wm/map-multi-polygon is a small Laravel/PHP package that adds a map-based multi-polygon editor to Laravel Nova forms. It is a thin presentation layer: a Vue component that serialises the polygon geometry you draw into a resource attribute. It is not a geometry engine, so spatial querying, validation and sanitisation on the backend remain your responsibility.
- Do I need Laravel Nova to use this package?
- Effectively yes. It is a Laravel Nova field package rather than application domain logic, so it renders inside Nova's form and detail views and writes geometry into a model column. Without a Nova installation on a compatible major version there is no UI to render, and you would have to extract the underlying map component and mount it yourself.
- How do I install and register the wm/map-multi-polygon field?
- Install it with composer require wm/map-multi-polygon, then add the field class to the fields() method of the Nova resource that should hold the geometry. The target column needs to exist first, usually a json or text column, or a spatial column fronted by an Eloquent cast. Verify the written payload after the first save before building anything on top of it.
- What data format does the field write to the database?
- The payload is not documented explicitly, so treat it as a data contract you must verify empirically. Expect either a GeoJSON MultiPolygon object, an array of coordinate rings, or WKT, written to a json or text column. Save a record containing a couple of polygons, inspect the raw attribute, and confirm the exact shape, coordinate order and assumed CRS (almost certainly WGS84/EPSG:4326).
- Does it handle true multi-polygons with interior holes?
- That depends on the bundled drawing library and the serialisation path, and multi-polygon semantics are exactly what tends to get flattened in thin field packages. Test a shape with two separate exterior rings plus an interior hole, save it, reload it and compare the round-trip. If extra rings or holes are dropped, do not rely on this field for geometry-critical data.
- Which Laravel, PHP and Nova versions are supported?
- Check the composer.json in the repository for the declared laravel/framework, php and nova constraints, and treat that range as unverified unless tests cover it. The critical constraint is the Nova major, because Nova field components are tightly coupled to Nova's private Vue/Inertia component API. Nova 4 to Nova 5 is a Vue 2 to Vue 3 breaking change for field packages.
- Can I use wm/map-multi-polygon with Filament, Livewire or Inertia?
- No. It is built specifically against Nova's field API, so it will not drop into Filament, plain Livewire, an Inertia/React front end or a headless API. For those stacks you would take the underlying map or drawing component and build the form field yourself. Budget for that as a rebuild rather than a port.
- Does it support PostGIS spatial queries like ST_Intersects or area calculation?
- No. The package is an editor, not a geometry engine: it stores what you draw but provides no ST_Intersects, spatial indexing, area computation or topology validation. If backend geospatial queries are required, persist to a PostGIS geometry(MultiPolygon, 4326) column behind an Eloquent cast and do the spatial work in SQL. The field's only job is producing the geometry payload.
- Which map tile provider does it use and are API keys required?
- Rendering requires a tile source and probably a drawing library, so expect an external runtime dependency with availability, rate-limit and key-management implications. Confirm which provider is bundled and whether credentials are injected server-side or exposed in the compiled client bundle, since a key shipped in JavaScript is a licensing and abuse problem. Also check the provider's terms for commercial tile usage.
- Is wm/map-multi-polygon safe to use in production?
- Treat it with caution: it has zero stars, zero dependents, a single agency publisher and no external documentation trail, so there is no community evidence the component has been exercised beyond the author's own deployments. It is a reasonable UI accelerator if you accept ownership of the data contract and are prepared to fork or replace the component at your next Nova upgrade. Wrap it behind a cast or adapter so the rest of the application never depends on the package directly.