Laravel 12 vs Laravel 13: What Actually Changed and When Should You Upgrade
Table of Contents
Two Releases, One Year Apart
Laravel 13 landed on March 17, 2026 – roughly thirteen months after Laravel 12 hit stable on February 24, 2025. Both versions follow the same annual cadence the framework has maintained since version 6, and both were described by Taylor Otwell as “maintenance releases” focused on developer experience rather than architectural overhauls. The key difference sits in scope: Laravel 12 cleaned up starter kits and dependency chains, while Laravel 13 adds an entire AI subsystem, native vector search, and a new approach to class-level configuration through PHP Attributes.
That framing matters if you run production apps on Laravel 12 and need to decide whether the upgrade justifies a sprint.
PHP Version Requirements
Laravel 12 requires PHP 8.2 as a minimum and supports up to PHP 8.5. Laravel 13 bumps that floor to PHP 8.3, dropping PHP 8.2 entirely. The ceiling stays at PHP 8.5.
PHP 8.3 brings typed class constants, a native json_validate() function, improvements to readonly properties, and JIT compiler optimizations. Laravel 13 removes polyfill and backcompat code that existed solely to keep PHP 8.2 running, which trims the framework’s internal footprint. On a typical Eloquent-heavy application, this cleanup shaves roughly 2-4% off cold-boot time in benchmarks published by the community – not dramatic, but free.
If your hosting environment still runs PHP 8.2 – common on shared cPanel-based plans – you must upgrade the runtime before touching composer.json. That single prerequisite is the only infrastructure-level change Laravel 13 demands.
Starter Kits and Authentication
Laravel 12 replaced Breeze and Jetstream with new first-party starter kits for React (Inertia + React 19 + TypeScript + Tailwind + shadcn), Vue (Inertia + Vue 3 + TypeScript + shadcn-vue), and Livewire 3 (Flux UI components). An optional WorkOS AuthKit variant added social login, passkeys, and SSO without additional wiring.
Laravel 13 keeps those same kits but layers on two features teams have requested for years. The first is URL-based team multi-tenancy – a reworked version of Jetstream’s old Teams feature. Users can now operate two different team contexts in separate browser tabs, which the session-based approach in Jetstream made impossible. The second is native passkey support baked directly into Laravel Fortify and the starter kit scaffolding, no longer requiring the WorkOS variant.
For greenfield projects, the Laravel 13 kits save a measurable amount of wiring. For existing Laravel 12 apps that already have auth in place, the starter kit changes are irrelevant unless you plan to rebuild your auth layer.
The Laravel AI SDK
This is the headline feature. Laravel 13 ships a first-party AI SDK that reached stable status on the same day as the framework release. The package provides a single, provider-agnostic interface for text generation, tool-calling agents, embeddings, image creation, audio synthesis, and vector store connections.
A minimal agent call looks like this:
use AppAiAgentsSalesCoach;
$response = SalesCoach::make()->prompt('Analyze this sales transcript...');
return (string) $response;
Image generation follows the same pattern:
use LaravelAiImage;
$image = Image::of('Product photo on white background')->generate();
$rawContent = (string) $image;
Embedding generation plugs directly into the Str helper:
use IlluminateSupportStr;
$embeddings = Str::of('Napa Valley has great wine.')->toEmbeddings();
Laravel 12 has nothing comparable at the framework level. Teams building AI features on Laravel 12 rely on third-party packages like openai-php/laravel or custom HTTP client wrappers for each provider. The AI SDK eliminates that fragmentation and gives AI-driven product features a standardized foundation.
Native Vector and Semantic Search
Laravel 13 introduces query-builder-level support for vector similarity search, targeting PostgreSQL with pgvector. The syntax fits naturally into existing Eloquent workflows:
$documents = DB::table('documents')
->whereVectorSimilarTo('embedding', 'Best wineries in Napa Valley')
->limit(10)
->get();
The framework also adds dedicated documentation sections for embeddings, vector columns, similarity search, and reranking. If your application already runs on PostgreSQL, this turns semantic search into a first-class query operation instead of a bolted-on service.
Laravel 12 offers no native vector support. Achieving similar results requires Scout with a third-party driver (Meilisearch, Typesense, Algolia) or raw SQL against a pgvector extension. The gap here is significant for any project that handles search-heavy or recommendation-driven workloads.
PHP Attributes Across the Framework
Laravel 13 introduces approximately 15 new PHP Attribute classes that replace traditional class property declarations. Models, listeners, notifications, mailables, broadcast events, commands, form requests, API resources, factories, and test seeders all support attribute-based configuration.
Before (Laravel 12 and earlier):
class User extends Model
{
protected $table = 'users';
protected $primaryKey = 'user_id';
protected $keyType = 'string';
public $incrementing = false;
}
After (Laravel 13, optional):
use IlluminateDatabaseEloquentAttributesTable;
#[Table('users', key: 'user_id', keyType: 'string', incrementing: false)]
class User extends Model
{
// ...
}
The old property syntax still works – nothing is deprecated. But the attribute approach consolidates configuration into a single declaration at the class level, which makes scanning large codebases faster. For teams that already adopted PHP 8.x patterns in their plugin and application code, this feels like a natural progression.
Queue Routing and Cache Improvements
Two smaller additions round out the developer-experience story. Queue::route() lets you define which queue and connection each job class should target from a single service provider, replacing the scattered $queue and $connection properties on individual job files.
Cache::touch() extends a cache item’s TTL without reading and rewriting its value. That sounds trivial until you realize the old approach required a get() followed by a put() with a new expiration – two round trips to the cache backend on every touch. On high-traffic pages that refresh session-adjacent cache keys, this cuts Redis or Memcached operations in half.
Laravel 12 ships neither of these. The workarounds exist (manual job properties, explicit get/put sequences), but they produce more boilerplate.
JSON:API Resources
Laravel 13 adds first-party JsonApiResource classes through IlluminateHttpResourcesJsonApiJsonApiResource. These handle resource serialization, relationship inclusion, sparse fieldsets, links, and compliant response headers automatically.
For teams building API-driven applications that need to conform to the JSON:API specification, this removes the need for third-party serialization packages or manual response shaping. Laravel 12 has no native JSON:API support.
Support Timeline Comparison
Laravel 12 receives bug fixes until August 13, 2026, and security patches until February 24, 2027. Laravel 13 gets bug fixes through Q3 2027 and security updates until March 17, 2028. That gives Laravel 13 roughly one extra year of coverage.
Both versions overlap until August 2026. If your project is stable on Laravel 12 and your team is mid-sprint on feature work, waiting until Q2 2026 to upgrade costs nothing – both versions receive patches during that window. The urgency only applies if you need the AI SDK, vector search, or PHP Attribute support for active development.
Package Compatibility
Major packages – Livewire, Inertia, Filament, and the Spatie suite – released Laravel 13 compatibility patches within days of launch. If you maintain custom packages that extend framework internals (custom cache stores, database operation abstractions, or manual Blueprint instantiation), review the upgrade guide for constructor signature changes in IlluminateDatabaseSchemaBlueprint and IlluminateDatabaseGrammar. These classes now require a Connection instance in their constructors.
Normal application code – routes, controllers, middleware, Eloquent models – should work without modification.
Reverb Database Driver
Laravel 13 adds a database-backed driver for Reverb, the first-party WebSocket server. This means Reverb no longer requires Redis in development or staging environments. A standard MySQL or PostgreSQL connection handles channel and presence tracking, which simplifies local development setups that already rely on a relational database.
Laravel 12 requires Redis for any Reverb deployment. The database driver option is new to version 13.
When the Upgrade Makes Sense
Upgrade now if your project needs AI integration, semantic search, or JSON:API compliance – or if you simply want the longer security window. The zero-breaking-changes promise holds for typical applications, and tools like Git-based deployment workflows make rollback trivial if something unexpected surfaces during testing.
Wait if your server environment still requires PHP 8.2 and upgrading the runtime is blocked by other applications sharing the same host. Also wait if you are in the middle of a release cycle and cannot allocate time for a staging pass. Laravel 12 remains fully patched until early 2027, so there is no penalty for delaying.
Често задавани въпроси
-
Does Laravel 13 require a newer PHP version than Laravel 12?
Yes. Laravel 12 supports PHP 8.2 through 8.5, while Laravel 13 raises the minimum to PHP 8.3. If your server runs PHP 8.2, you need to upgrade the runtime before switching to Laravel 13.
-
Are there breaking changes when upgrading from Laravel 12 to Laravel 13?
The official release notes state zero breaking changes to application code. The only hard requirement is PHP 8.3+. Most apps can upgrade in under an hour.
-
What is the Laravel AI SDK introduced in Laravel 13?
The Laravel AI SDK is a first-party package that provides a unified API for text generation, tool-calling agents, embeddings, image generation, audio synthesis, and vector store integrations. It supports multiple providers including OpenAI and Anthropic.
-
How long will Laravel 12 receive security patches?
Laravel 12 receives bug fixes until August 13, 2026, and security patches until February 24, 2027. There is no rush to upgrade immediately.
-
Can Laravel 12 and Laravel 13 use the same starter kits?
Laravel 12 introduced React, Vue, and Livewire starter kits. Laravel 13 extends those same kits with team-based multi-tenancy and passkey authentication built in.
Related Articles
If you enjoyed reading this, then please explore our other articles below:
More Articles
If you enjoyed reading this, then please explore our other articles below:




2019-2026 ©