
9 minutes read
Laravel 10 is out! Here are every new features and changes.
Table of contents
- → Introduction
- → Laravel 10 release date
- → Is Laravel 10 LTS (long term support)?
- → How to install Laravel 10?
- → How to upgrade to Laravel v10?
-
→
What’s new in Laravel 10: features and changes
- → Feature flags with Laravel Pennant
- → New Process facade
- → Test profiling (–profile)
- → Validation rules are invokable by default
- → Native type declarations in the skeleton
- → First-party packages also use native types
- → Config path customization
- → Schema native operations in migrations
- → Composer 2.2 or newer requirement
- → Dropped support for PHP 8.0
- → Predis v1 removal
- → dispatchNow() removed
- → Many deprecated methods and properties removed
- → How to contribute to Laravel 10?
- → Laravel v10 bug hunt: win $1K for fixing bugs
- → Conclusion
Introduction
Laravel 9 is retiring. The framework has a new 10th version, and I walk you through what’s new.
Laravel 10 release date
Laravel 10 was released on February 14, 2023.
But take it slow. It doesn’t mean you have to update all your projects immediately.
Laravel 9 will receive bug fixes until August 8, 2023 and security fixes until February 6, 2024.
Version | PHP | Release | Bug fixes until | Security fixes until |
---|---|---|---|---|
9 | 8.0–8.2 | February 8, 2022 | August 8, 2023 | February 6, 2024 |
10 | Minimum PHP: 8.1+ | February 14, 2023 | August 6, 2024 | February 4, 2025 |
Is Laravel 10 LTS (long term support)?
No, Laravel 10 isn’t LTS, but it provides two years of support.
The framework last had LTS in version 6 and you can learn all about LTS versions here.
Like I said, each major version offers two years of bug and security fixes, which is plenty of time to prepare your application to upgrade to the next major version.
How to install Laravel 10?
Using the official Laravel installer:
laravel new hello-world
Or, if you prefer to use Composer explicitly:
composer create-project --prefer-dist laravel/laravel hello-world
Note: Laravel 10 requires PHP 8.1+.
How to upgrade to Laravel v10?
Upgrading to Laravel 10 requires more than just following upgrade instructions. Before proceeding, think this through.
Check out my guide to upgrading to Laravel 10 if you need more clarification about the process and considerations you should have before giving the green light. I also talk about a practical way to automate parts of the process, which is helpful for agencies and larger teams.
What’s new in Laravel 10: features and changes
Feature flags with Laravel Pennant

Laravel Pennant is a first-party package that adds feature flags to any Laravel 10 project.
composer require laravel/pennant
Feature flags are a way to enable or disable features at runtime without changing your code.
For instance, you can deploy a feature only for a select set of users in your production environment. This is great for A/B testing.
use Laravel\Pennant\Feature; use Illuminate\Support\Lottery; Feature::define('new-onboarding-flow', function () { return Lottery::odds(1, 10); });
Check if the user has access to the feature:
if (Feature::active('new-onboarding-flow')) { // ... }
There’s even a Blade directive:
@feature('new-onboarding-flow') ... @endfeature
Learn more about Laravel Pennant on the official documentation. Laravel News also has a step-by-step tutorial.
New Process facade
Laravel 10 introduced a simple yet comprehensive API for the Symfony Process component, enabling you to run external processes within your Laravel application easily.
This is how you use it:
use Illuminate\Support\Facades\Process; $result = Process::run('ls -la'); return $result->output();
You can even run processes concurrently:
use Illuminate\Process\Pool; use Illuminate\Support\Facades\Process; [$first, $second, $third] = Process::concurrently(function (Pool $pool) { $pool->command('cat first.txt'); $pool->command('cat second.txt'); $pool->command('cat third.txt'); }); return $first->output();
There’s more to learn about processes in the official documentation. See the pull request on GitHub: Process DX Layer PR (#45314).
Test profiling (–profile)
The Artisan command php artisan test
can receive a --profile
option that shows the 10 slowest tests, so you can spot bottlenecks quickly. Parallel testing pairs well with this (php artisan test --parallel
).
If your project upgrades to PHPUnit 10, make sure you are on nunomaduro/collision
^7.0.

Validation rules are invokable by default
In Laravel 9, invokable validation rules could be generated using the --invokable
flag with php artisan make:rule
. Starting with Laravel 10, new rules implement Illuminate\Contracts\Validation\ValidationRule
and define a validate
method.
php artisan make:rule Uppercase
namespace App\Rules; use Closure; use Illuminate\Contracts\Validation\ValidationRule; class Uppercase implements ValidationRule { /** * Run the validation rule. */ public function validate(string $attribute, mixed $value, Closure $fail): void { if (strtoupper((string) $value) !== (string) $value) { $fail('The :attribute must be uppercase.'); } } }
This boilerplate is small and easy to understand. See the ValidationRule
interface in the API docs.
Native type declarations in the skeleton
Starting with Laravel 10, the skeleton uses native types instead of docblocks.
For instance, in the Laravel skeleton, the schedule()
method in app/Console/Kernel.php looks like this:
/** * Define the application's command schedule. - * - * @param Illuminate\Console\Scheduling\Schedule $schedule - * @return void */ - protected function schedule($schedule) + protected function schedule(Schedule $schedule): void
The team also added generic type annotations, which improves autocompletion even further (given your code editor supports generics). See the pull request on GitHub: PHP native type declarations PR (#6010).
First-party packages also use native types
Official packages for Laravel won’t be left out of this transition. Native type hints will be used across the Laravel organization. You can check out this PR, which starts the switch from docblocks to native type hints in Laravel Jetstream.
Config path customization
A contributor added the possibility to set a custom path for config files. This is useful for projects slowly migrating to Laravel that can’t handle a big directory structure change.
In your bootstrap/app.php, use the useConfigPath()
method on the $app
object:
$app->useConfigPath(__DIR__ . '/../some/path');
(And did you also know about bootstrapPath()
, databasePath()
, langPath()
, etc.? Laravel is highly customizable.) Learn more: Config path customization PR (#46053).
Schema native operations in migrations
Column modifications can now use native database operations in most drivers, so you don’t need doctrine/dbal
for common changes.
// ... return new class extends Migration { public function up(): void { Schema::table('foo', function (Blueprint $table) { $table->unsignedBigInteger('bar')->change(); }); } // ... };
Drivers vary, and SQLite is a notable exception. If your project still has Doctrine DBAL installed (for example, to support multiple connections), you can ask Laravel to use native operations when possible and fall back to DBAL only when needed:
use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { public function boot(): void { Schema::useNativeSchemaOperationsIfPossible(); } }
Tip: when changing column types, re-apply attributes like unsigned
or default
if your driver drops them during the change.
Composer 2.2 or newer requirement
To ensure solid foundations for every new Laravel 10 project, the framework requires Composer 2.2 or newer.
Dropped support for PHP 8.0
Laravel 10 drops support for PHP 8.0 and requires PHP 8.1 at minimum. If you want to upgrade, move to PHP 8.1 or 8.2. Don’t rush—plan and test carefully.

Predis v1 removal
If you’re forcing the usage of Predis v1 in your project, upgrade to v2 (predis/predis
^2.0) or consider using PHP’s native Redis extension, which is often faster.
See the pull request on GitHub: Drop Predis v1 support PR.
dispatchNow() removed
dispatchNow()
was deprecated in Laravel 9 in favor of dispatchSync()
and was removed in Laravel 10. Search and replace it across your codebase—this is an easy fix. See the pull request on GitHub: Remove deprecated dispatchNow functionality PR.
Many deprecated methods and properties removed
Releasing a major version also means the Laravel team can remove features that were deprecated in Laravel 9. Carefully test any Laravel application you plan to migrate to version 10.
Here’s a list of related PRs:
- Remove deprecated Route::home method
- Remove deprecated assertTimesSent
- Remove deprecated method
- Remove deprecated dates property
- Use native PHP 8.1 array_is_list function
- Remove deprecations
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: browse laravel/framework pull requests. 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 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 v10 bug hunt: win $1K for fixing bugs

Taylor Otwell announced the Laravel 10 Bug Hunt. Fix bugs, and you could be one of the random winners who receive $1K.
The contest ended when Laravel 10.0 stable shipped on February 14, 2023.
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 labeled, and a random winner will be selected at the end of the contest.
More details on the official Laravel blog: Laravel 10 Bug Hunt
Conclusion
Laravel 10 brings a lot of quality-of-life updates: Pennant for feature flags, the new Process facade, invokable validation rules, native type declarations, and clear Composer/PHP requirements (Composer 2.2+, PHP 8.1+). Keep an eye on support timelines (Laravel 9 bug fixes until August 8, 2023; security fixes until February 6, 2024).
Ready to move forward? Start with my upgrade to Laravel 10 guide.
Did you like this article? Then, keep learning:
- Learn to fix common Laravel runtime errors and issues
- Improve your Laravel app by efficiently clearing cache
- Comprehensive upgrade steps complement Laravel 10 new features coverage
- Discover Laravel Pennant for feature flags introduced in Laravel 10
- Explore Laravel 11 changes for upcoming framework migration planning
- Prepare for future with early insights into Laravel 12
- Step-by-step guide to upgrade from Laravel 8 to 9 gives context
- Learn the role of maintenance mode and how to use it
- Master Laravel's test profiling for better app performance
- Understand Laravel's Artisan tool, key in framework productivity
0 comments