swisnl/filament-geometry
A Filament form field for drawing and editing map geometries. Let users place points, draw lines, and outline polygons on an interactive map, then save the result as GeoJSON in your database. Adds spatial input to your admin panel with simple, familiar field configuration and no custom JavaScript re...
Architecture fit: swisnl/filament-geometry is a thin Filament form-field plugin that wraps Leaflet/Leaflet.draw to capture and persist geometry (GeoJSON) against an Eloquent model. It is not a GIS platform — it is a UI adapter plus a cast/serialization layer. Fit is therefore narrow and good: if the product need is "let an operator draw a polygon/polyline/point on a map inside an admin panel," this is close to the minimum viable dependency. If the need is spatial querying, tile layers, coordinate systems, or PostGIS-backed search, the package is only the capture surface and the real architecture work sits outside it.
Integration feasibility: High. Installation is composer + Filament plugin registration + a form field schema entry and a model cast. No service, queue, or external API dependency at runtime; no vendor account. The 0.8.1 change — Filament 5.x compatibility — materially improves feasibility for greenfield work, because it removes the main blocker (pinning the admin panel to Filament 4.x). Effort is measured in hours, not sprints, for a single field.
Technical risk: The dominant risk is maturity, not complexity. Pre-1.0 versioning (0.8.x) means the public API and the composer constraint surface can move under us; Filament major-version support in this release is a signal that the maintainer tracks upstream, but it also means the package's own majors may lag Filament's cadence. Secondary risks: client-side dependency on Leaflet/Leaflet.draw (a largely frozen upstream) and the usual CDN/asset-publishing question for a JS-bearing plugin; and storage-format lock-in — if geometry is persisted as raw GeoJSON in a JSON/text column, downstream spatial queries require either a derived column or a PostGIS migration later. Data-loss risk is low (geometry is user-drawn), but malformed/partial geometries and null handling are worth a validation rule.
Key questions:
allow)?Stack fit: Requires PHP 8.x, Laravel, Filament (4.x or 5.x per the constraint), Livewire, and Node/npm for asset publishing. It sits entirely inside the admin panel layer — no impact on the public application, API, or domain model beyond the cast attribute. That containment is the main integration virtue: it can be adopted, isolated, or removed without touching core business logic.
Migration path: Two distinct paths. (a) Net-new field: additive, non-breaking, ship behind a feature flag on one resource first. (b) Replacing an existing free-text lat/lng pair or a hand-rolled map widget: this is a data migration — you need a backfill that converts stored coordinates to the package's expected geometry shape, plus a dual-read or shadow-write period so records created before the switch remain editable. Treat (b) as a small project with its own rollback, not as a composer update.
Compatibility: Filament major version is the binding constraint and should be pinned explicitly in composer.json rather than inherited transitively, so a future composer update cannot silently cross a Filament major. Verify the 0.8.1 constraint against our actual installed Filament version before committing. Leaflet/Leaflet.draw versions and the asset-publish step are the second compatibility surface — confirm how assets are served in our deploy (published to public/ vs. Vite) so we do not ship a field that renders an empty div in production. Also confirm Livewire version alignment, since the field participates in the Livewire component lifecycle.
Sequencing:
Maintenance: Low ongoing cost, but non-zero ownership. We own the pinned version, the asset-publish step, and any wrapper code (custom validation, casts, resource configuration). We do not own Leaflet. Budget a small recurring allowance to track upstream Filament majors — this release is exactly that kind of event, and it will recur roughly on Filament's cadence. The Leaflet.draw layer is a slow-moving dependency that will eventually need a decision (accept, replace, or fork).
Support: Internal support surface is small: "the map doesn't render," "my drawing didn't save," "I can't edit an old record." Each maps to a known cause — asset pipeline, validation/JS error, or data-shape mismatch from a legacy record. Worth a short runbook and one saved example. Vendor support is community/GitHub-issue only; there is no SLA, which is acceptable for an admin-panel convenience feature and unacceptable if geometry capture ever becomes a revenue-critical or compliance-critical workflow.
Scaling: Negligible server-side scaling impact — it is a form field; load is bounded by admin concurrency, not end users. Two scale-adjacent caveats: geometry payloads make rows larger and can bloat admin queries if the column is selected broadly (exclude it from list/table queries); and any spatial querying requirement will outgrow the package's storage model and force a PostGIS or derived-index decision. Client-side, large/complex geometries (many vertices) can degrade Livewire round-trips — cap vertex count via validation if users draw freely.
Failure modes:
Ramp-up: Effectively immediate for a Laravel/Filament-fluent developer — a few hours to a working field, under a day including validation and tests. The learning curve is not the package; it is the surrounding decisions (storage format, query strategy, validation rules) that a less experienced developer is likely to skip. Recommend one person own those decisions explicitly rather than letting them accrete. No specialist GIS knowledge required at this scope — and that is precisely the limit of the tool: the moment GIS knowledge is required, this package stops being the answer.
How can I help you explore Laravel packages today?