What We Know About Laravel 13
Laravel

What We Know About Laravel 13

Laravel 13 is set to be a significant release of the popular PHP framework, scheduled for launch in March 2026. This upcoming version promises to introduce several new features and improvements that will enhance the development experience for Laravel users. In this article, we will explore the key features and changes expected in Laravel 13, the PHP version requirements, the support timeline, and how to upgrade your projects to this latest version.

New Features in Laravel 13

Laravel 13 will introduce a variety of new features, many of which are designed to streamline development and improve performance. As new features are announced, this section will be updated to reflect the latest information.

PHP Attributes Support

One of the most notable additions in Laravel 13 is the support for PHP 8 Attributes. This feature allows developers to use attributes as an alternative to traditional class properties for configuring Laravel components. This change is non-breaking, meaning that existing property-based configurations will continue to function as before.

Eloquent Models

Laravel 13 will introduce new attributes that replace the need to define certain properties on Eloquent models. For example:

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

These new attributes include:

  • #[Appends]
  • #[Connection]
  • #[Fillable]
  • #[Guarded]
  • #[Hidden]
  • #[Table]
  • #[Touches]
  • #[Unguarded]
  • #[Visible]

Queue Jobs

Queue configuration will also see improvements. Developers can now define queue attributes directly on the job class:

#[Connection('redis')]
#[Queue('podcasts')]
#[Tries(3)]
#[Timeout(120)]
class ProcessPodcast implements ShouldQueue {}

Available queue attributes will include:

  • #[Backoff]
  • #[Connection]
  • #[FailOnTimeout]
  • #[MaxExceptions]
  • #[Queue]
  • #[Timeout]
  • #[Tries]
  • #[UniqueFor]

Console Commands

Laravel 13 will allow console commands to define their signature and description using attributes instead of class properties:

#[Signature('mail:send {user} {--queue}')]
#[Description('Send a marketing email to a user')]
class SendMailCommand extends Command {}

Other Components

Attributes will also be available for various other components, including:

  • Form requests (#[RedirectTo], #[StopOnFirstFailure])
  • API resources (#[Collects], #[PreserveKeys])
  • Factories (#[UseModel])
  • Test seeders (#[Seed], #[Seeder])

Cache Improvements

Another significant improvement in Laravel 13 is the addition of the Cache::touch() method. This method allows developers to extend the time-to-live (TTL) of a cached item without needing to fetch or re-store the value. Here are some examples of how to use it:

// 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);

This method streamlines the process of extending cache TTLs, making it more efficient. It is implemented across all cache drivers, including Array, APC, Database, DynamoDB, File, Memcached, Memoized, Null, and Redis.

PHP Version Requirements

Laravel 13 will require PHP 8.3 as the minimum version. This marks an increase from Laravel 12, which required PHP 8.2. Developers will need to ensure their environments are updated to meet this requirement to take advantage of the new features and improvements.

Support Timeline

Following Laravel’s established support policy, Laravel 13 will receive bug fixes and security updates for a defined period. The support timeline is as follows:

VersionPHP VersionRelease DateBug Fixes UntilSecurity Fixes Until
108.1 – 8.3February 14th, 2023August 6th, 2024February 4th, 2025
118.2 – 8.4March 12th, 2024September 3rd, 2025March 12th, 2026
128.2 – 8.5February 24th, 2025August 13th, 2026February 24th, 2027
138.3 – 8.5Q1 2026Q3 2027Q1 2028

Laravel 12, which was released on February 24, 2025, will continue to receive bug fixes until August 13, 2026, and security fixes until February 24, 2027.

Upgrading to Laravel 13

For developers looking to upgrade their projects to Laravel 13, an easy solution is to use Laravel Shift. This service automates the process of upgrading Laravel applications, creating pull requests with clear and atomic commits for review in just a few clicks. This can save developers significant time and effort when transitioning to the latest version.

Frequently Asked Questions

What are the new features in Laravel 13?

Laravel 13 introduces several new features, including PHP Attributes support for configuring components, improved Eloquent model attributes, enhanced queue job configuration, and new console command signatures. Additionally, it includes a Cache::touch() method for extending cache TTLs efficiently.

What is the minimum PHP version required for Laravel 13?

Laravel 13 will require PHP 8.3 as the minimum version, which is an upgrade from Laravel 12’s requirement of PHP 8.2.

How can I upgrade my project to Laravel 13?

To upgrade your project to Laravel 13, you can use Laravel Shift, which automates the upgrade process by creating pull requests with atomic commits for easy review. This service helps streamline the transition to the latest version.

Call To Action

Stay ahead of the curve by upgrading to Laravel 13 and taking advantage of its new features. Ensure your projects are running on the latest version to benefit from improved performance and security. Contact us today to get started!

Note: Laravel 13 promises to bring significant improvements and features that will enhance the development experience. Stay updated with the latest advancements in the Laravel ecosystem to ensure your applications remain modern and efficient.

Disclaimer: Tech Nxt provides news and information for general awareness purposes only. While we strive for accuracy, we do not guarantee the completeness or reliability of any content. Opinions expressed are those of the authors and not necessarily of Tech Nxt. We are not liable for any actions taken based on the information published. Content may be updated or changed without prior notice.