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

Laravel 10 is now released!

Published on by

Laravel 10 is now released! image

Laravel 10 is now released, including a minimum PHP v8.1 version, a new Laravel Pennant package, invokable validation rules, native type declarations, and more...

Laravel Release Schedule

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 14th, 2023
  • Laravel 11: Q1 2024

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

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

Let's look at some of the big new features in Laravel 10:

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.

Laravel Pennant

Laravel Pennant is a package created by the Laravel team that will arrive with Laravel 10 and provides Feature Flags for your applications.

Feature flags enable you to incrementally roll out new application features with confidence, A/B test new interface designs, compliment a trunk-based development strategy, and much more.

This package is the latest in the lineup of official packages provided by the core team and means that we now have a well-built and well-tested package that provides us with some great functionality.

Process layer for Laravel

The Laravel Process service makes testing and running CLI processes a dream to work with.

use Illuminate\Support\Facades\Process;
 
$result = Process::run('ls -la');
 
$result->successful();
$result->failed();
$result->exitCode();
$result->output();
$result->errorOutput();
$result->throw();
$result->throwIf($condition);

The Process layer includes rich features out of the box, such as:

  • Fluent process methods to build a process instance before running it
  • Process output handling as it is received
  • Asynchronous processes
  • Process Pools
  • Rich testing features via fake()
  • Preventing stray processes during tests

Testing processes has never been easier.

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 will 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 --invokable
artisan 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

Profile option for tests

A new feature coming to Laravel 10 is a --profile option that will make it easy for you to find any slow tests in your application.

This --profile option should help keep your tests fast and help you either fix the slow tests or to better group them to make it easier not to run them all the time.

New String Password helper

The Str::password method can generate a secure, random password of a given length. The password will consist of a combination of letters, numbers, symbols, and spaces. By default, passwords are 32 characters long:

use Illuminate\Support\Str;
 
$password = Str::password();
 
// 'EbJo2vE-AS:U,$%_gkrV4n,q~1xy/-_4'
 
$password = Str::password(12);
 
// 'qwuar>#V|i]N'

Deprecations from Laravel 9

Methods marked as deprecated in Laravel 9 are being removed in Laravel 10. We can expect the release upgrade guide to outline 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:

Testing Laravel 10

If you want to start testing Laravel 10 now, you can install it in a new project by using the --dev flag:

laravel new <your-project-name> --dev

Upgrading to Laravel 10

The easiest way to upgrade is to utilize Laravel Shift and it can automate always keeping your application up to date, or follow the upgrade guide.

And More...

You can also check out the official releases page to look for updated information as it becomes available.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in:
Cube

Laravel Newsletter

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

image
Bacancy

Outsource a dedicated Laravel developer for $3,200/month. With over a decade of experience in Laravel development, we deliver fast, high-quality, and cost-effective solutions at affordable rates.

Visit Bacancy
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
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
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 →
Generate Secure, Memorable Passphrases in PHP with PHP Passphrase image

Generate Secure, Memorable Passphrases in PHP with PHP Passphrase

Read article
FrankenPHP v1.11.2 Released With 30% Faster CGO, 40% Faster GC, and Security Patches image

FrankenPHP v1.11.2 Released With 30% Faster CGO, 40% Faster GC, and Security Patches

Read article
Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot image

Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot

Read article
Nimbus: An In-Browser API Testing Playground for Laravel image

Nimbus: An In-Browser API Testing Playground for Laravel

Read article
Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout image

Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout

Read article
Handling Large Datasets with Pagination and Cursors in Laravel MongoDB image

Handling Large Datasets with Pagination and Cursors in Laravel MongoDB

Read article