Skip to content

13.0.0 — Laravel 13

Choose a tag to compare

@fatk fatk released this 10 Oct 18:31
· 50 commits to master since this release

Themosis 13 runs on Laravel 13 (illuminate/* ^13.35). Laravel 12 stays on the 12.x branch (^12.0) for fixes.

Requirements

  • PHP 8.3+ (was 8.2). On PHP 8.4+ Composer installs the Symfony 8 components; PHP 8.3 gets Symfony 7.4.
  • WordPress 6.8+ (tested on WordPress 7.1, PHP 8.5).

Dependencies

  • illuminate/* ^12.69 → ^13.35
  • laravel/tinker ^3.0 only (2.x doesn't support Laravel 13)
  • guzzlehttp/guzzle ^7.8.2|^8.0 (Laravel 13 allows Guzzle 8)
  • Floors raised to Laravel 13's: dragonmantank/cron-expression ^3.4, vlucas/phpdotenv ^5.6.1, ramsey/uuid ^4.7
  • Dev: beyondcode/laravel-dump-server removed (no Laravel 13 release), PHPUnit ^12.5.8|^13.0.3, paratest ^7.20, PHPUnit configuration migrated to the current schema

Laravel 13 port

  • CSRF: new PreventRequestForgery middleware (Laravel 13). Same-origin requests (Sec-Fetch-Site) pass without a token; allowSameSite(), useOriginOnly(), static except(). VerifyCsrfToken is now a deprecated subclass, so app middleware extending it keeps working.
  • Exception handler: dontRetry(), dontRetryWhen(), shouldStopRetries() (used by the queue worker), isReporting(), contextForException(), buildContextForException() (used by the JSON log formatter). OriginMismatchException renders a 403 and isn't reported.
  • Console: findCommand() on the console kernel.
  • Routing: domain routes match before routes without a domain.
  • Caches: route:cache restores the facades and container instance after booting a fresh app; optimize --except=routes,view:cache.
  • Bus/events: PendingChain (prepend(), append(), dispatchIf()/dispatchUnless()) and the event Dispatchable trait synced with Laravel 13.
  • Logging: with logging.deprecations.trace, deprecations are logged with the ErrorException in the context (Laravel 13 format, with a stack trace).

Fixes

  • Terminating callbacks never ran: dispatchAfterResponse() jobs and the components' terminating callbacks were silently dropped.
  • Bus::chain() and AnonymousEvent failed with "class not found" (Illuminate\Foundation\Bus\PendingChain, Illuminate\Foundation\Events\Dispatchable are now aliased).
  • The encrypted X-XSRF-TOKEN header was never read (X-CSRF-TOKEN was checked twice).
  • unauthenticated() threw an ArgumentCountError (redirectTo() without the request). Without a redirect target it now returns an empty 401 instead of redirecting to route('login').
  • Routes sharing a URI and their last HTTP method (e.g. POST and PUT|POST) were dropped from getRoutes() and from the route cache.
  • Twig\Environment resolved a new environment instead of the shared twig binding (the alias still used the Twig 1 class name).
  • Application: added isProduction() and getBootstrapProvidersPath() (called by Laravel components), isLocal(), runningConsoleCommand() and currentLocale().

Upgrade notes for sites

  1. In composer.json, require "themosis/framework": "^13.0" (and "php": "^8.3"), then run composer update. Sites still on dev-laravel-12-upgrade or ^4.0 stay on Laravel 12: that branch is frozen at 12.0.0, so move them to ^12.0 or ^13.0.
  2. Packages requiring illuminate/* must allow 13. laravel/tinker 3, laravel/ui 4.6 and propaganistas/laravel-phone 6 do.
  3. After deploying, rebuild the caches with composer deploy (optimize, then opcache:clear). Route and config caches built with Laravel 12 must not be reused.
  4. Check the Laravel 13 changes that depend on your configuration (upgrade guide):
    • the new cache/Redis prefixes, session cookie name, cache.serializable_classes => false and session serialization => json only come with Laravel 13's skeleton config files. Existing Themosis config/*.php files keep their values; don't copy the new skeleton values without reading the guide (changing the session serialization or cookie logs users out);
    • pagination view names (pagination::default → pagination::bootstrap-3);
    • upsert() with an empty uniqueBy now throws.
  5. CSRF: where the csrf middleware is enabled, same-origin requests now pass without a token (Laravel 13 behaviour).
  6. The errors.php mu-plugin, which masked E_DEPRECATED while WP_DEBUG was on, can be removed. Deprecations, including compile-time ones, go to the deprecations channel (WP_DEBUG on) or are discarded (WP_DEBUG off), and are never displayed.

Known issues

  • make:auth stays disabled (its stubs reference traits that don't exist).
  • On a fatal error, Themosis' handleShutdown and WordPress' fatal error handler can both render.

Full changelog: 12.0.0...13.0.0