Try Depot: Bring ultra-fast, remote Docker builds directly to your Laravel workflow

Laravel 13 Released: PHP 8.3, Attributes, Laravel AI, and a Smoother Upgrade Path

Published on by

Laravel 13 Released: PHP 8.3, Attributes, Laravel AI, and a Smoother Upgrade Path image

Laravel 13 is now released. This release will require PHP 8.3 as the minimum version and will follow Laravel's standard support cycle with bug fixes through Q3 2027 and security updates through Q1 2028.

According to the Laravel team:

Much of our focus during this release cycle has been minimizing breaking changes. Instead, we have dedicated ourselves to shipping continuous quality-of-life improvements throughout the year that do not break existing applications.

As always, if you want a simple way to upgrade check out Laravel Shift.


What's New in Laravel 13

PHP 8.3 Is Now Required

Laravel 13 drops support for PHP 8.2 and now requires PHP 8.3 or higher.

First-Class Support for PHP Attributes

The biggest developer-facing improvement is the introduction of native PHP Attributes across many parts of the framework.

// EXAMPLE MODEL
 
#[Table('users', key: 'user_id', keyType: 'string', incrementing: false)]
#[Hidden(['password'])]
#[Fillable(['name', 'email'])]
class User extends Model {}

Instead of configuring behavior through class properties, you can now define things inline using attributes:

  • Models
  • Jobs
  • Console commands
  • And more (15+ locations)

This is fully optional and backward compatible.

Laravel AI SDK

Laravel 13 introduces the first-party Laravel AI SDK, providing a unified API for text generation, tool-calling agents, embeddings, audio, images, and vector-store integrations.

JSON:API Resources

Laravel now includes first-party JSON:API resources, making it straightforward to return responses compliant with the JSON:API specification.

JSON:API resources handle resource object serialization, relationship inclusion, sparse fieldsets, links, and JSON:API-compliant response headers.

Read More: https://laravel.com/docs/13.x/eloquent-resources#jsonapi-resources

Queue Routing

Laravel 13 adds queue routing by class via Queue::route(...), allowing you to define default queue / connection routing rules for specific jobs in a central place:

Queue::route(ProcessPodcast::class, connection: 'redis', queue: 'podcasts');

Semantic / Vector Search

Laravel 13 has native vector query support, embedding workflows, and related APIs documented across search, queries, and the AI SDK.

These features make it straightforward to build AI-powered search experiences using PostgreSQL + pgvector, including similarity search against embeddings generated directly from strings.

For example, you may run semantic similarity searches directly from the query builder:

$documents = DB::table('documents')
->whereVectorSimilarTo('embedding', 'Best wineries in Napa Valley')
->limit(10)
->get();

Cache::touch()

PR #55954 adds a Cache::touch() method that extends a cached item's TTL without fetching or re-storing the value:

// Extend by seconds
Cache::touch('user_session:123', 3600);
 
// Extend with a DateTime
Cache::touch('analytics_data', now()->addHours(6));
 
// Extend indefinitely
Cache::touch('report_cache', null);

Previously, extending a TTL required a get followed by a put, which meant transferring the cached value over the wire unnecessarily. Cache::touch() skips that — Redis uses a single EXPIRE command, Memcached uses TOUCH, and the database driver issues a single UPDATE.

The method returns true on success and false if the key doesn't exist. It's implemented across all cache drivers: Array, APC, Database, DynamoDB, File, Memcached, Memoized, Null, and Redis.


Laravel 13 Support Timeline

Following Laravel's established support policy, Laravel 13 will receive bugfixes until Q3 2027 and security updates until Q1 2028:

Version PHP (*) Release Bug Fixes Until Security Fixes Until
10 8.1 - 8.3 February 14th, 2023 August 6th, 2024 February 4th, 2025
11 8.2 - 8.4 March 12th, 2024 September 3rd, 2025 March 12th, 2026
12 8.2 - 8.5 February 24th, 2025 August 13th, 2026 February 24th, 2027
13 8.3 - 8.5 Q1 2026 Q3 2027 Q1 2028

Laravel 12, released February 24, 2025, will continue receiving:

  • Bug fixes until August 13, 2026
  • Security fixes until February 24, 2027

Upgrading to Laravel 13

If you want an easy way to keep your projects up to date with the latest versions check out Laravel Shift. Shift will open a PR with nice, atomic commits for you to review in just a few clicks.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Lens for Laravel Brings WCAG Auditing to Your Local Dev Workflow image

Lens for Laravel Brings WCAG Auditing to Your Local Dev Workflow

Read article
Browse and Execute Artisan Commands from an Interactive TUI image

Browse and Execute Artisan Commands from an Interactive TUI

Read article
Laravel Pint Now Replaces Fully Qualified Class Names with Imports image

Laravel Pint Now Replaces Fully Qualified Class Names with Imports

Read article
Inertia v3 Upgrade Prompt and JSON Log Support in Laravel Boost v2.3.0 image

Inertia v3 Upgrade Prompt and JSON Log Support in Laravel Boost v2.3.0

Read article
Laracon AU Returns to Brisbane - Call for Speakers Now Open image

Laracon AU Returns to Brisbane - Call for Speakers Now Open

Read article
Detecting and Fixing Race Conditions in Laravel Applications image

Detecting and Fixing Race Conditions in Laravel Applications

Read article