A Look at What's Coming to Laravel 10

A Look at What's Coming to Laravel 10

Laravel v10 is the next major version of Laravel, planned for release on February 7th, 2023. In this post, we wanted to outline all the new features and changes that we know about.

We encourage you to check back on this post in the coming weeks as we will continue to monitor what's coming in Laravel 10 and update this post leading up to the February release.

Laravel 10 Release Date

Before Laravel 9, major framework versions were released twice a year or roughly every six months. Starting with Laravel 9, the core team went to an annual schedule, shipping Laravel 9 in February of 2022 (instead of the originally planned September 2021):

Laravel uses a variety of community-driven packages as well as nine Symfony components for a number of features within the framework. Symfony 6.0 is due for release in November. For that reason, we are choosing to delay the Laravel 9.0 release until 2022.

By delaying the release, we can upgrade our underlying Symfony components to Symfony 6.0 without being forced to wait until September 2022 to perform this upgrade. In addition, this better positions us for future releases as our yearly releases will always take place two months after Symfony's releases.

This schedule going forward is one major release annually:

  • Laravel 9: February 8th, 2022

  • Laravel 10: February 7th, 2023

  • Laravel 11: February 6th, 2024

Laravel 9 will continue to get bug fixes until August 8th, 2023 and security fixes until February 6th, 2024.

You can expect Laravel 10 bug fixes until August 6th, 2024 and security fixes until February 4th, 2025.

Laravel 10 drops support for PHP 8.0

Laravel framework will drop support for PHP <=v8.0 in Laravel 10. The minimum required version is PHP ^8.1. Browsing the comparison between master and 9.x, we can expect to see 8.1 features used in the framework, such as readonly properties.

Native type declarations in Laravel 10 skeleton

In Laravel 10, the Application Skeleton Code Will Have Native Type Declarations. This means that any code in userland generated by the framework will have type-hints and return types. Our article discusses the caveats around the approach, and we think you're going to love the added types when creating new projects in the future.

Types are being added in a way that brings the latest PHP type-hinting features to Laravel projects without breaking backward compatibility at the framework level:

  • Return types

  • Method arguments

  • Redundant annotations are removed where possible

  • Allow user land types in closure arguments

  • Does not include typed properties

Invokable Validation rules are the default

Starting in Laravel 10, invokable validation rules are now the default. When you create a new validation rule via artisan, this is what you can expect:

# Laravel 9 creates a rule class that implements the
# Illuminate\Contracts\Validation\Rule interface
artisan make:rule Uppercase 
# Laravel 9 flag to create an invokable and implicit rule
artisan make:rule Uppercase --invokableartisan make:rule Uppercase --invokable --implicit 
# Laravel 10 creates an invokable rule by default
artisan make:rule Uppercase 
# Laravel 10 implicit rule
artisan make:rule Uppercase --implicit

Deprecations from Laravel 9

Methods marked at deprecated in Laravel 9 are being removed in Laravel 10. We can expect the release upgrade guide to outlining all the deprecated methods, potential impact assessment, and how to upgrade closer to the release.

Here are some deprecations found in the comparison of the Laravel framework's master branch to the 9.x branch at the time of writing:

And More...

Laravel 10 is still a few months away, and more new features and announcements will be coming out. We will be updating this post as those get announced. You can also check out the official release page to look for updated information as it becomes available.