Laravel 10: release date and new features
Table of contents
- When will Laravel 10 be released?
- How to install Laravel 10?
- New features and changes in Laravel 10
- Laravel Pennant: feature flags with ease
- Artisan becomes more interactive
- Laravel 10 uses invokable validation rules by default
- The Laravel 10 skeleton uses native types instead of docblocks
- Official packages will also use native types
- Dropped support for PHP 8.0
- Dropped support for Predis v1
- dispatchNow() has been removed
- Many deprecated methods and properties have been removed
- doctrine/dbal is not needed anymore to modify columns in migrations
- How to contribute to Laravel 10?
- Laravel 10 Bug Hunt: win $1K for fixing bugs

When will Laravel 10 be released?
According to the Support Policy, Laravel 10 is scheduled to be released in February 7, 2023.
The release of Laravel 10 doesn’t mean you have to update all your projects immediately, though.
The framework last had LTS (Long-Term Support) in version 6, but each major version now has two years of updates, which should give you enough time to get your codebase in check and upgrade it.
Laravel 9 will receive bug fixes until August 23, 2023 and security fixes until February 6, 2024.
Version | PHP | Release | Bug fixes until | Security fixes until |
---|---|---|---|---|
9 | 8.0 - 8.1 | February 8, 2022 | August 8, 2023 | February 6, 2024 |
10 | 8.1 | February 7, 2023 | August 6, 2024 | February 4, 2025 |
How to install Laravel 10?
Installing Laravel 10 is easy. The Laravel installer has a --dev
flag, which installs the master branch from the laravel/laravel repository.
laravel new hello-world --dev
Or, if you prefer to explicitly use Composer:
composer create-project --prefer-dist laravel/laravel laravel-dev dev-master
New features and changes in Laravel 10
Laravel Pennant: feature flags with ease
Laravel Pennant is a first-party package that adds feature flags to any Laravel 10 project.
Features flags are a way to enable or disable features at runtime without changing your code.
For instance, you may want to deploy a feature only for a select set of users in your production environment. This is great for A/B testing.
The package isn’t available yet.
Artisan becomes more interactive
Starting from Laravel 10, Artisan will be more interactive. Say you ask it to create a model but forgot to pass the name:
php artisan make:model
Instead of throwing an error, it will just ask you the name of the model, but also if you want to create a migration, a factory, etc. Extremely handy!
php artisan make:model What should the model be named?❯ Post Would you like any of the following? [none] none ......................................................................................... 0 all .......................................................................................... 1 factory ...................................................................................... 2 form requests ................................................................................ 3 migration .................................................................................... 4 policy ....................................................................................... 5 resource controller .......................................................................... 6 seed ......................................................................................... 7
Laravel 10 uses invokable validation rules by default
In Laravel 9, invokable validation rules could be generated using the --invokable
flag with the php artisan make:rule
command. Starting from Laravel 10, you won’t need it anymore.
php artisan make:rule Uppercase
To remind you a bit of what invokable validation rules are, here’s what they look like:
namespace AppRules; use IlluminateContractsValidationInvokableRule; class Uppercase implements InvokableRule{ /** * Run the validation rule. * * @param string $attribute * @param mixed $value * @param Closure(string): IlluminateTranslationPotentiallyTranslatedString $fail * @return void */ public function __invoke($attribute, $value, $fail) { if (strtoupper($value) !== $value) { $fail('The :attribute must be uppercase.'); } }}
The boilerplate code is considerably smaller and easier to understand. Thanks to Laravel 10, people will be less intimidated by the perspective of making custom validation rules.
See the pull request on GitHub: [10.x] Make invokable rules default
The Laravel 10 skeleton uses native types instead of docblocks
Starting with Laravel 10, the skeleton will now use native types instead of docblocks. This PR is massive and is still a work in progress, because it will happen in the whole Laravel organization.
For instance, in the Laravel skeleton, the schedule()
method in app/Console/Kernel.php will look like this:
/** * Define the application's command schedule.- * - * @param IlluminateConsoleSchedulingSchedule $schedule- * @return void */- protected function schedule($schedule)+ protected function schedule(Schedule $schedule): void
The team will also add generic type annotations, which will drastically improve autocompletion as well when coding (given your code editor supports generics).
See the pull request on GitHub: [10.x] Uses PHP Native Type Declarations 🐘
Official packages will also use native types
Actually, you won’t have to wait until Laravel 10 to enjoy native type hints in official Laravel packages. It’s rolling out right now.
As you may know, we're adding types to user-land code in Laravel 10.x. This applies across the first-party package ecosystem as well, including stubs and starter kits.
— Taylor Otwell 🪐 (@taylorotwell) January 3, 2023
To get a head start, we've begun releasing some of these changes in packages like Breeze and Jetstream. 🔥 pic.twitter.com/mqkhL7udhb
You can check out this PR, that initiates the switch from dockblocks to native type hints in Laravel Jetstream.
Dropped support for PHP 8.0
Laravel 10 dropping support for PHP 8.0 and requiring 8.1 as a minimum means two things if you want to upgrade:
- Either move to PHP 8.1
- Or PHP 8.2
But remember: your Laravel apps don’t need to be updated to the latest and greatest as soon as they’re released.
Especially if you have projects with paid clients or employees who depend on them to do their work.
They need to slowly but surely move forward by doing extensive testing. Don’t rush.
See the pull request on GitHub: [10.x] Drop PHP 8.0
Dropped support for Predis v1
If you’re forcing the usage of Predis v1 in your project, you might want to upgrade to v2.
To see what changed in Predis v2, take a look at the changelog.
See the pull request on GitHub: [10.x] Drop Predis v1 support
In my opinion, instead of using Predis, you should consider using PHP’s native Redis extension, which is faster and could speed up your website if you have a lot of traffic.
dispatchNow() has been removed
dispatchNow()
is a popular method in Laravel. It was deprecated in Laravel 9 in favor of dispatchSync()
. Laravel 10 will remove it, so be sure to search and replace it in all of your projects. It may be a breaking change, but it’s an extremely easy fix.
See the pull request on GitHub: [10.x] Remove deprecated dispatchNow functionality
Many deprecated methods and properties have been removed
Releasing a major version also means the Laravel team can finally remove features that have been deprecated in Laravel 9. It also means you should carefully test any Laravel application you might want to migrate to version 10.
Here’s a list of all PRs taking care of that:
- [10.x] Remove deprecated Route::home method
- [10.x] Remove deprecated assertTimesSent
- [10.x] Remove deprecated method
- [10.x] Remove deprecated dates property
- [10.x] Use native php 8.1 array_is_list function
- [10.x] Remove deprecations
doctrine/dbal is not needed anymore to modify columns in migrations
Column modifications happen in your migrations like so:
… return new class extends Migration{ public function up() { Schema::table('foo', function (Blueprint $table) { $table->unsignedBigInteger('bar')->change(); }); } …}
In Laravel 9, you had to install doctrine/dbal to do the job. But now, migrations support the native operations provided by most of the databases Laravel supports.
Suppose you have multiple database connections and already installed Doctrine DBAL. In that case, you should call Schema::useNativeSchemaOperationsIfPossible()
to use native operations before falling back on the package (for instance, SQLite doesn’t support this yet).
use Illuminate\Support\Facades\Schema; … class AppServiceProvider extends ServiceProvider{ public function boot() { Schema::useNativeSchemaOperationsIfPossible(); }}
Learn more:
- [10.x] Add support for native column modifying
- [9.x] Add support for native rename/drop column commands
How to contribute to Laravel 10?
Did you know you could create the next big feature for Laravel 10?
- See what’s going on for Laravel 10 on GitHub: https://github.com/laravel/framework/pulls. The Pull Requests will tell you what’s already been done.
- Take one of your pain points with the framework and create a solution yourself.
- Send the PR over to the laravel/framework repository, collect feedback, improve and get merged.
One important tip to increase your chances of being merged: add something to the framework that’s a win for developers, but not a pain to maintain for Taylor and his team in the long run.
Laravel 10 Bug Hunt: win $1K for fixing bugs
Taylor Otwell announced the Laravel 10 bug hunt.
Fix bugs, and be one of the random winner to get $1K richer!
This contest will end as soon as Laravel 10 is released.
Here are the rules:
- Only PRs sent to the 10.x branch of the laravel/framework repository are eligible.
- Only “true” bug fixes are accepted. New features, refactoring, or typo fixes will not be counted.
- Every bug fix must include a test.
- Accepted bug fixes will be labelled, and a random winner will be selected at the end of the contest.
More details on the official Laravel blog: Laravel 10 Bug Hunt
This is what’s new in Laravel 10 for now.
There’s more to come until February 2023, though.
Don’t miss any update on this post. Subscribe to my newsletter and follow me on Twitter!