Skip to main content

Laravel 13.38.0

Release Date: October 20, 2026

Verdict: worth updating for any app that reads from a database replica. Laravel 13.38.0 landed on October 20, 2026, and the headline feature fixes a bug that has burned time for basically every team that scaled past a single database.

The Bug Everyone Has Hit

A user submits a form. The write goes to the primary. The redirect loads the page, the read hits a replica that is a couple hundred milliseconds behind, and the record is not there. Refresh, and everything is fine again. Multiply that across every list page in the app and you get bug reports that nobody can reproduce.

Version 13.38.0 ships a PreventStaleDatabaseReads middleware for exactly this case. Once a request performs a write, the middleware pins the reads for the remainder of that request onto the write connection. The user sees the data they just saved, and everything else keeps reading from replicas as before.

DB::usingWritePdo()

The second piece is a matching API. DB::usingWritePdo() gives you a scoped block of reads that must come from the write connection, which is the tool you want inside relationship loads and raw aggregation code that middleware cannot infer on its own.

DB::usingWritePdo(fn () => Order::with("items")->find($orderId));

Validation, Queues, and the Rest

Validation gained more object-style parity with the string syntax, continuing the Rule builder work that started in 13.36.0. The release also carries fixes across queues, routing, scheduling, and database connections for edge cases reported against 13.37.0.

  • Reads after writes stay on the write connection when the middleware is enabled.
  • Relationship queries can be forced onto the write PDO in a scoped block.
  • Validation rules gain more builder-style configuration options.
  • Queue, routing, and scheduler fixes for the issues filed against the previous tag.

How I Upgraded

  1. Ran composer update laravel/framework and the full test suite.
  2. Registered the middleware on routes that mutate data and then read in the same request.
  3. Audited replica-read paths for relationship loads that assume fresh data.
  4. Read the diff between 13.37.0 and 13.38.0 on GitHub before deploying.

13.38.0 follows 13.37.0 from October 16, 2026, which is the normal weekly cadence for the 13.x line. This is a minor release, so no breaking changes are expected.

Other Versions

We use cookies for ads and analytics.