Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Geometry Laravel Package

spinen/laravel-geometry

A Laravel package for working with geometric data in Eloquent models. It provides casts and helpers for spatial types like points, lines, and polygons, making it easier to store, retrieve, and query geometry values in your database.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: This is a thin Laravel/Eloquent wrapper over geoPHP, not a complete geospatial platform. It fits Laravel applications that need basic hydration/serialization of spatial column values into geoPHP geometry objects, especially where the database already owns spatial storage and indexing. It is a poor fit for advanced GIS analytics, coordinate transformations, routing, tiling, or high-volume spatial computation, which should remain in the database or a dedicated geospatial service.
  • Integration feasibility: Feasible for a small, bounded use case if the application’s Laravel/PHP/database versions match the package’s constraints. It requires spatial-capable database columns and extensions, plus validation of geometry types, SRID handling, and serialization behavior. The package is likely quick to wire into Eloquent models, but the surrounding spatial data model and migrations are the real integration effort.
  • Technical risk: High. The last release was 2020-06-19, adoption is low at 41 stars, and the package depends on geoPHP, which introduces transitive maintenance and compatibility risk. Expect possible gaps with modern Laravel/PHP versions, PHP 8+, database dialect differences, geometry type coverage, and long-term support. Without evidence of active maintenance, treat it as a tactical adapter rather than a strategic dependency.
  • Key questions: Which Laravel, PHP, and geoPHP versions are supported? Which databases and spatial extensions are validated—MySQL, MariaDB, PostgreSQL/PostGIS? Which geometry types and SRIDs are in scope? How are WKB, WKT, GeoJSON, and null geometries handled? Are SRID mismatches detected or silently transformed? What is the test coverage and license? Who owns maintenance if the upstream package remains inactive? Can the team fork, patch, or replace it without changing domain code?

Integration Approach

  • Stack fit: Best suited to an existing Laravel application using Eloquent and a spatial database where the need is to read/write geometry values in PHP. Keep geoPHP objects at the infrastructure boundary; do not leak them across domain services or APIs. Prefer database-native spatial functions for filtering, distance, containment, and indexing.
  • Migration path: Pilot in one bounded context, such as storing points or polygons for a single feature. Introduce an internal geometry adapter or repository contract so the package is an implementation detail. If the package becomes incompatible, replace it with a custom Eloquent cast backed by native SQL or an actively maintained geometry library without rewriting domain logic.
  • Compatibility: Pin the package and geoPHP versions, then verify against the exact Laravel/PHP/database matrix in CI. Test MySQL and PostgreSQL separately if both are supported. Validate round-trip behavior for representative geometries, SRIDs, empty values, large geometries, and malformed inputs. Confirm how model serialization exposes geometry data in APIs.
  • Sequencing: First inventory spatial columns, SRIDs, geometry types, and query patterns. Next validate database extensions and migration support. Then run a sandbox proof of concept covering read, write, cast, serialization, and one spatial query path. Add contract tests before production. Roll out to a low-risk feature, monitor errors and performance, and only then broaden usage. Maintain a documented exit plan to native SQL/custom casts.

Operational Impact

  • Maintenance: Expect low upstream activity. Budget for version pinning, dependency auditing, and possible fork/vendoring. Assign an internal owner. Reassess on every Laravel/PHP upgrade and whenever geoPHP or database drivers change.
  • Support: Community support only, with limited adoption and no vendor SLA. Ramp-up and troubleshooting knowledge will largely be internal. Avoid using the package in business-critical paths without a maintained fork or a clear replacement plan.
  • Scaling: The package is not a scaling layer. Hydrating large geometries in PHP can increase memory and CPU use, so avoid selecting geometry columns unnecessarily and keep spatial filtering/indexing in the database. Use bounding boxes, pagination, and projection/selection limits where possible.
  • Failure modes: Common risks include Laravel/PHP version conflicts, unsupported geometry types, SRID mismatches, database driver differences, serialization errors, silent coordinate truncation, and abandonment of the upstream dependency. Add validation at write boundaries, monitoring for cast failures, and tests for every supported geometry type and SRID.
  • Ramp-up: Laravel developers should become productive quickly on the Eloquent integration, but spatial database concepts and geoPHP behavior require specialized review. Document SRID conventions, supported geometry types, query patterns, and fallback procedures. Training is modest for basic use but non-trivial for production-grade spatial correctness.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib