Laravel v9 will be another LTS form of Laravel, and it’ll be coming out at some point in early January 25th, 2022. In this post, we wanted to describe all the modern highlights and changes announced so far.
Laravel 9 Release Date Changes
Laravel v9 was planned to be released around September 2021, but the Laravel Crew chose to thrust this release back to January 25th, 2022.
Laravel utilizes an assortment of community-driven packages as well as nine Symfony components for several highlights inside the framework. Symfony 6.0 is due for release in November. For that reason, we are deciding to hold the Laravel 9.0 release until January 2022. By postponing the release, we will update our basic Symfony components to Symfony 6.0 without being constrained to hold up until September 2022 to perform this update.
It means that the future Laravel release schedule will seem as follows:
Version | PHP (*) | Release | Bug Fixes Until | Security Fixes Until |
---|---|---|---|---|
6 (LTS) | 7.2 – 8.0 | September 3rd, 2019 | January 25th, 2022 | September 6th, 2022 |
7 | 7.2 – 8.0 | March 3rd, 2020 | October 6th, 2020 | March 3rd, 2021 |
8 | 7.3 – 8.1 | September 8th, 2020 | July 26th, 2022 | January 24th, 2023 |
9 (LTS) | 8.0 – 8.1 | January 25th, 2022 | January 30th, 2024 | January 28th, 2025 |
10 | 8.0 – 8.1 | January 24th, 2023 | July 30th, 2024 | January 28th, 2025 |
PHP 8 is the minimum version in Laravel 9
Since Laravel 9 will need Symfony 6.0 and it incorporates a least prerequisite of PHP 8 which means Laravel 9 will carry this same confinement.
Anonymous Stub Migrations
At the beginning of this year, Laravel 8.37 came out with a new feature called Anonymous Migrations that restricts migration class name collisions.
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('people', function (Blueprint $table) {
$table->string('first_name')->nullable();
});
}
};
When Laravel 9 releases, this will be the default when you run php artisan make:migration
New Query Builder Interface
Appreciations to Chris Morrell, Laravel 9 will highlight a new Query Builder Interface, and you can view this merged PR for all the details.
For developers who depend on sort insights for static analysis, refactoring, or code completion in their IDE, the need for a shared interface or legacy between Query\Builder, Eloquent\Builder, and Eloquent\Relation can be much complex.
return Model::query()
->whereNotExists(function($query) {
// $query is a Query\Builder
})
->whereHas('relation', function($query) {
// $query is an Eloquent\Builder
})
->with('relation', function($query) {
// $query is an Eloquent\Relation
});
This highlight adds a new Illuminate\Contracts\Database\QueryBuilder interface and an Illuminate\Database\Eloquent\Concerns\DecoratesQueryBuilder trait that implements the interface in point of the existing __call implementation.
PHP 8 String Functions
Since PHP 8 will be the least, Tom Schlick acknowledged a PR to move to using str_contains(), str_starts_with() and str_ends_with() functions internally in the \Illuminate\Support\Str class.