What to expect in laravel 10

February 13, 2023ยท4 min read
What to expect in laravel 10: An overview of upcoming features and changes

Today, In this post we wanted to outline What to expect in laravel 10: An overview of upcoming features and changes.

Laravel v10 is the next major version of Laravel after Laravel v9 and laravel v8, planned for release in February 2023.

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 2022 (instead of the originally planned September 2021).

This schedule going forward is one major release annually:

  • Laravel 9: February 8th, 2022
  • Laravel 10: February 2023
  • Laravel 11: February 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.

Process Layer

The laravel process layer service like the HTTP facade makes working with APIs a cinch, The process service will make working with Testing and running CLI process a dream to work with. You can check following example from Pull request by Taylor Otwell.

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

Which includes the features such as:

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

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.

Native type declarations in Laravel 10 skeleton

Laravel 10 will use native PHP type declarations across any generated code that can exist in userland:

Twitter

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
  • Allow user land types in closure arguments
  • Does not include typed properties

Invokable Validation rules are the default

Starting in laravel 10, Invokable Validation are now default.

When you create a new validation rule via artisan, this is what you can expect:

invokable
# 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.

Deprecations from Laravel 9

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:

  • Remove handleDeprecation method
  • Remove deprecated assertTimesSent method
  • Remove deprecated ScheduleListCommand's $defaultName property
  • Remove deprecated Route::home method
  • Remove deprecated dispatchNow functionality

Testing Laravel 10

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

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

We are in February 2023, Waiting for the more new features and announcements. We will be updating this post as those get announced. You can also check out the official release page to look for updates.

Thank You ! Cheers...

Happy Coding!

Go back Home.