Skip to content

Build1 publisher2 min readPublished

Laravel 13's ten-minute upgrade hinges on what your tests still call VerifyCsrfToken

Laravel calls the breaking changes in 13 minimal, and the upgrade guide still flags about nineteen of them. Two land in defaults that every application touches: the request forgery middleware and the cache config.

The Engineer · Build desk

What happened

  • Laravel 12 stopped getting bug fixes on August 13, 2026 and its security patches end on February 24, 2027, according to a dev.to walkthrough of the upgrade to 13.
  • The official upgrade guide flags two high-impact changes, two medium-impact ones and roughly fifteen low-impact ones for Laravel 13.
  • VerifyCsrfToken is renamed PreventRequestForgery, and the new middleware verifies request origin by reading the browser's Sec-Fetch-Site header as well as validating the token.
  • Laravel 13 requires PHP 8.3 as a minimum and supports up to 8.5, and the post says the circulating claim that it needs 8.4 in practice is wrong.
  • Laravel 11 has had no security patches since March 12, 2026, and the post describes Laravel 11 as uncovered.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • constraint Any defect in Laravel 12 that is not a security issue is now the operator's to patch or to upgrade away from, because the release line takes nothing else.
  • decision Teams on 11 have to budget two major upgrades instead of one, since the post routes them through 12 before 13, one major at a time.
  • cost Shops still on PHP 8.2 pay for two changes to two systems, and the post wants the runtime moved first so that only one of them can be the cause when something breaks.
  • exposure The size of the job depends on objects in the cache, upsert on MySQL, and CSRF middleware excluded in tests.

Call `withoutMiddleware([VerifyCsrfToken::class])` in a Laravel 13 test and the class you named is a deprecated alias, kept around so nothing explodes on day one [11]. The exclusion may not apply the way you assumed, because the alias points elsewhere, according to a dev.to walkthrough of the upgrade [13]. The post says test suites that call it expecting to disable the protection are where this really bites [13]. The middleware configuration API now exposes `preventRequestForgery(...)` [12]. The check before you upgrade is one command: `grep -rn "VerifyCsrfToken\|ValidateCsrfToken" app/ tests/ routes/ bootstrap/` [14].

The second high-impact default is in the cache configuration, which now ships `serializable_classes => false` as hardening against deserialization gadget chain attacks [15]. The published post breaks off partway through that section, so the remediation is missing.

Laravel's own docs put the job at ten minutes and say most applications can upgrade "without changing much application code" [3]. That figure describes someone else's application. It transfers if nothing in `app/`, `tests/` or `routes/` references the old CSRF class names [11], nothing you put in the cache is a serialized PHP object [15], and you are already on PHP 8.3 or newer [8]. Ten minutes is an estimate for the code.

The dependency work is wider than the framework constraint. The post's `composer.json` moves `laravel/tinker` to `^3.0`, PHPUnit to `^12.0`, Pest to `^4.0` for Pest users and `laravel/boost` to `^2.0` [16]. Tinker and the PHPUnit major are the two the author says people forget [17].

Support is now uniform across every major: 18 months of bug fixes, two years of security patches, and no LTS tier [7]. Subtract one from the other and the security-only tail on any Laravel major is six months [21]. For 12 that tail runs 195 days, and roughly nineteen flagged breaking changes sit on the far side of it [19][20].

What to watch

  • Whether the deprecated VerifyCsrfToken and ValidateCsrfToken aliases survive Laravel 14, or get removed and turn a quiet test assumption into a fatal error.
  • Whether Laravel documents a migration path for applications that legitimately cache serialized PHP objects under serializable_classes => false.
  • Any movement on the February 24, 2027 security cutoff for Laravel 12.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories