News

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

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

Release updates

Never miss a Laravel release

Get an email whenever a new Laravel release lands.

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.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
Laravel monitoring that doesn't bill you by your traffic image

Laravel monitoring that doesn't bill you by your traffic

Read article
Mock PHP Classes in Tests With the Double Library image

Mock PHP Classes in Tests With the Double Library

Read article
Laravel Discount: Coupon Codes, Usage Limits, and Stacking image

Laravel Discount: Coupon Codes, Usage Limits, and Stacking

Read article
Laravel Truss: Live Interactive Database ER Diagrams image

Laravel Truss: Live Interactive Database ER Diagrams

Read article
Laravel artisan dev: Run Server, Queue, Logs, and Vite image

Laravel artisan dev: Run Server, Queue, Logs, and Vite

Read article
Validate and Convert HEIC Images in Laravel image

Validate and Convert HEIC Images in Laravel

Read article