Logo

contact

Qubic Business Center, Office 8A, Sin el Fil

+961-3-054401
Laravel 13 Released: PHP 8.3, Attributes, Laravel AI, and a Smoother Upgrade Path banner

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

Codeloops
gradiant

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.

The method returns true on success and false if the key does not exist. It is implemented across all cache drivers.

Laravel 13 Support Timeline

Following Laravel's established support policy, Laravel 13 will receive bug fixes 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

 

Posted on:

July 2, 2026

share: