colopl/laravel-spanner
Laravel database driver for Google Cloud Spanner. Adds Eloquent and query builder support so applications can use Spanner as a familiar backend with models, migrations, transactions, and session handling, simplifying integration with Google's globally distributed database.
isolation_level configurable (feat: allow isolation_level to be set in config). That turns transaction isolation from a hardcoded assumption into a per-service configuration decision — relevant when moving a Postgres-dialect workload to Spanner, where REPEATABLE_READ vs SERIALIZABLE has direct bearing on contention, retry rates, and read throughput.clear session when dropping a database change — carried into the stable v12.0.0 — directly supports harnesses that create and tear down ephemeral Spanner databases per test run. That matters if the roadmap includes per-PR integration environments or parallel test shards; it is the failure mode that otherwise makes those harnesses flaky.ORDER BY) matters here specifically: migrations that already produce correctly-shaped indexes previously produced mis-named ones, so teams with existing Spanner schemas should treat this as a possible correction step, not a no-op.feat: cloud spanner v2 moves the driver onto the v2 client library. That double floor feeds directly into how the platform team sequences Laravel and GCP SDK upgrades across the fleet.LIKE check per query in the parameterizer; timestamp timezone conversion moved before Carbon instantiation) reduces per-query and per-row overhead. On Spanner, where cost is driven by processing units and CPU, per-row overhead is a TCO line item — this weakens the "the driver itself is too slow for high-volume paths" objection.Adopt when:
ORDER BY, now handled correctly.isolation_level per service or per environment.Look elsewhere when:
ORDER BY and you cannot verify whether they were created with correct names — validate before upgrading rather than discovering it at query time.For executives: This is the piece that lets our existing Laravel applications run on Google Cloud Spanner without a bespoke data-access layer or a dedicated driver team, and as of v12.0.0 it is a stable major release rather than a beta — one of the two risks we previously flagged is now retired. The remaining risk is support: it is community-maintained with no commercial backing or SLA. Recommended posture is to run a pilot, keep Spanner optional at the architecture level, and size Spanner's baseline capacity cost, which remains the larger financial commitment by far. The release also lands performance and correctness fixes that reduce the cost of high-volume read paths and make ephemeral per-PR test databases viable.
For engineering: v12.0.0 is the stable cut of the major line: Eloquent, query builder, schema builder, and migrations, with request-scoped session handling for read-your-writes. Three things to plan around. First, it moves onto the Cloud Spanner v2 client — budget that as a compound upgrade alongside the Laravel/PHP version floor. Second, isolation_level is now configurable, so decide deliberately per service rather than inheriting a default. Third, the index-name fix for ORDER BY indexes may change what migrations emit; diff generated DDL against existing production schemas before rolling forward. The session-clearing fix on database drop is in this release, which is what makes a per-PR Spanner CI harness non-flaky. Performance-wise, LIKE checks are hoisted to once per query and timestamp timezone conversion no longer runs per row through Carbon. Before adoption: confirm the Laravel/PHP/client floors against upgrade notes, run our integration suite against a dedicated GCP project, and check how the driver surfaces Spanner's transaction-abort retries so we don't inherit silent retry gaps in write-heavy paths.
How can I help you explore Laravel packages today?