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

Postgis Bundle Laravel Package

utafitilabs/postgis-bundle

Utafitilabs PostGIS Bundle adds PostGIS spatial support to PHP/Laravel applications, helping you define geometry and geography columns, run spatial migrations, and build location-aware queries for mapping and proximity features with less boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The release artifact is a Symfony/Doctrine bundle, not a Laravel package: namespace UtafitiLabs\PostGISBundle, a DI config key (utafiti_labs_post_gis), Doctrine DQL functions, a Doctrine schema listener, and a repository base class. Every one of these primitives is Symfony/Doctrine-ORM, not Laravel/Eloquent.
  • There is no Eloquent integration in this release: no Illuminate\Database custom type registration, no query-builder macros, no migration column helpers, no service provider. A Laravel application cannot consume this package as-is.
  • Therefore architecture fit is poor for a Laravel codebase and good for a Symfony + Doctrine ORM codebase. This is the single most important finding in the release and should gate any further evaluation.

Integration feasibility

  • On a Symfony/Doctrine stack: feasible and small in surface area. The bundle appears to ship four things — (1) PostGIS column type mappings, (2) spatial DQL functions for use in queries, (3) a schema listener that participates in doctrine:schema:* diffing, (4) an abstract spatial repository. All are standard Doctrine extension points, so wiring is low-effort.
  • On a Laravel stack: not feasible without an adapter. Options are (a) build a Doctrine bridge in Laravel (Doctrine ORM inside Laravel is possible but a significant architectural decision), (b) write a thin Eloquent/Query Builder port of the type mappings and use raw SQL functions, or (c) select a Laravel-native spatial package instead.
  • Hard prerequisite in all cases: the PostGIS extension installed and enabled on every target database, including CI and ephemeral test databases. That is an environment/infrastructure task, not a code task, and is frequently the real cost center.

Technical risk

  • Pre-1.0 (v0.1.0). SemVer permits breaking changes in minor bumps; API, config key shape, and repository base signature should be treated as unstable. Pin exactly and read every changelog.
  • Provenance unverified. The feature set closely mirrors an established Doctrine PostGIS integration (types + DQL functions + schema listener). If this is a fork or rebrand, confirm license compatibility, upstream divergence policy, and whether security/bug fixes will be tracked. If it is greenfield, the maintenance surface is a single-party risk.
  • Schema listener is the highest-blast-radius component. A listener that participates in schema diffing can emit unexpected ALTER/DROP statements. Any use of doctrine:schema:update or migration-diff generation against a database containing spatial columns needs to be validated in a disposable environment first.
  • Spatial indexing is not advertised. Mapping geometry types does not create GiST indexes. Unindexed spatial predicates (ST_Intersects, ST_DWithin, bbox &&) degrade to sequential scans on large tables — a silent performance cliff rather than an error.
  • SRID and geometry-vs-geography semantics are unspecified in the notes. 4326 vs projected SRIDs, and geometry vs geography type choice, are correctness issues that surface as wrong results, not exceptions.

Key questions

  1. Is this package intended for Laravel at all, or is the "Laravel/PHP" framing from the request a mismatch with the actual artifact? (Blocking.)
  2. Is this a fork of an existing Doctrine PostGIS bundle, and if so, what is the upstream/divergence and license position?
  3. Does the schema listener create/drop spatial indexes, or only column types? What does its diff output look like on a database with pre-existing GiST indexes?
  4. Which SRIDs and which geometry/geography types are supported, and how are mismatches handled (exception vs silent coercion)?
  5. Minimum supported PHP / Symfony / Doctrine DBAL / PostgreSQL / PostGIS versions?
  6. Who maintains it, what is the release cadence, and is there a stated stability policy before 1.0?

Integration Approach

Stack fit

  • Decision point first: confirm the target application's stack. If it is genuinely Laravel/Eloquent, this package is out of scope and the evaluation should pivot to a Laravel-native spatial option or an in-house type mapping. If the organization runs Symfony services (or Laravel with Doctrine ORM), proceed.
  • Recommended framing: treat this as a Symfony/Doctrine capability, and record explicitly that it does not serve the Laravel service unless an adapter is committed to.

Migration path

  • No migration is required — this is the first release and there is no incumbent to move off.
  • Conversely, there is no upgrade path into this package from raw-SQL spatial code beyond rewriting queries to use the new DQL functions. Budget for that rewrite as part of adoption, not as a later step.

Compatibility

  • Verify the full matrix before adoption: PHP version, Symfony bundle registration format, Doctrine DBAL/ORM major version (DBAL 3.x vs 4.x type registration differs materially), PostgreSQL major version, PostGIS major version.
  • Confirm the package's DBAL version support specifically — custom type registration APIs changed between DBAL 2, 3, and 4, and a v0.1.0 bundle is unlikely to span all of them.
  • Confirm behavior under doctrine:schema:validate and in test environments where PostGIS may not be installed.

Sequencing

  1. Stack confirmation (Laravel vs Symfony/Doctrine) — gate for everything below.
  2. Provenance and license review — before any code is written against it.
  3. Throwaway spike: enable PostGIS in a disposable Postgres, register the bundle, map one geometry column, run one spatial query end-to-end. Target ~2–3 days.
  4. Schema listener validation in a disposable environment, comparing generated diffs against a hand-managed schema with existing GiST indexes.
  5. Index strategy design (GiST indexes, SRID choice, geometry vs geography) — hand-written migrations, not relying on the listener.
  6. Pilot on one non-critical spatial feature before broad adoption.
  7. Re-evaluate at v1.0 or at the first minor release that changes the public API.

Operational Impact

Maintenance

  • Pre-1.0 with an unclear stability policy means upgrade overhead is recurring, not one-off. Assume every minor release requires a review. Pin the exact version in composer.json and treat upgrades as scheduled work with a test pass.
  • The bundle's surface is small (types, DQL functions, listener, repository base), which caps the audit cost per upgrade — a favorable ratio if the project is healthy.
  • Fork risk is the main ongoing exposure: if upstream fixes are not tracked, the team inherits maintenance of the spatial type mappings itself.

Support

  • No support tier, SLA, or maintainer commitment is evident from the release. Support model is effectively community/self-serve.
  • Internal mitigation: designate one engineer as owner of spatial data concerns, with a documented fallback path (raw SQL + hand-written migrations) that does not depend on the bundle. The raw-SQL fallback is genuinely viable for PostGIS, which limits vendor lock-in.

Scaling

  • Performance is governed almost entirely by index presence and query shape, not by the bundle. Ensure GiST indexes exist on every spatially-queried column before production traffic.
  • Watch for sequential scans on spatial predicates; these are invisible in application logs and only appear in EXPLAIN / pg_stat_statements. Add an explicit check to the performance review for spatial queries.
  • geography types trade some index behavior and precision characteristics for meters-based distance semantics; the choice should be deliberate per column, not a default.
  • Schema listener cost is confined to migration/diff operations, not runtime requests.

Failure modes

  • Missing PostGIS extension → migration and test-suite failures, often only in CI or a fresh environment. Mitigate by provisioning the extension in the base image and in every ephemeral database bootstrap.
  • Schema listener emitting unexpected DDL → accidental index or column drops during diff generation. Mitigate by running diff generation against a disposable clone and reviewing output before applying.
  • Unregistered DQL function → query-time exceptions that surface late, often in a code path not covered by the spike. Mitigate with a test that exercises each spatial function used.
  • SRID mismatch / geometry-vs-geography confusion → wrong results or exceptions, not crashes; the most dangerous class because it can pass review.
  • Unindexed spatial columns → silent latency growth as data volume increases; no error signal.
  • Null and empty geometry handling → inconsistent behavior across the type mapping and repository base; needs explicit test coverage.
  • Pre-1.0 API break on upgrade → build failures or changed runtime behavior after a routine dependency bump.

Ramp-up

  • For a Symfony/Doctrine team already fluent in custom DBAL types and bundle registration: low, roughly 2–3 days to a working spike.
  • Required adjacent knowledge: PostGIS fundamentals (SRIDs, geometry vs geography, GiST indexing, EXPLAIN on spatial predicates). This is usually the real ramp-up cost and is independent of the package.
  • For a Laravel/Eloquent team: high — the ramp-up includes Doctrine ORM concepts the package assumes, plus the adapter decision. Not recommended without a specific reason to adopt Doctrine.
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.
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
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle