OthersOthers

Laravel 9.7 Released: What Do You Need to Know?

Laravel-9.7

Laravel does not need any introduction. It has been one of the most preferred PHP frameworks for web application development. It is a highly scalable, elegant, and easy-to-use PHP framework that has carved a niche.

Laravel has released the latest Laravel 9.7 version update, and this blog will discuss everything you need to know about the new Laravel 9.7 released version update.

What’s New in Laravel 9.7?

The new Laravel 9 version was scheduled to be released by September 2021. However, it was postponed to January 2022 and then February 2022. The New

Laravel 9.7 released version is the first long-term support release that has been introduced after the 12-month release cycle. The delay in release was due to many reasons, such as:

  • Laravel uses nine Symfony libraries. Now the thing is that Symfony will release the new version 6.0 by November 2021. The Laravel team wanted to incorporate this new version in their Laravel 9.7 version. 
  • Also, the Laravel team wanted to check how the new version interacts with the new Symfony version and to fix and address issues and bugs. 
  • It gave the Laravel team more than two months after Symfony’s release to be in a better position. 

We have covered almost all Laravel 9.7 release notes to understand the new version better in this post.

New Features in Laravel 9.7

Now we will discuss the list of the new features and improvements in the Laravel 9.7 version. 

Minimum PHP Requirement

Thankfully, Laravel 9.7 will require PHP 8 and PHPUnit 8 for testing the web applications. It is because Laravel 9 uses the new Symfony v6.0 that also uses PHP 8. PHP 8 is the latest version with amazing improvements, and if you have not updated to the latest PHP 8 version, you need to do it now. 

Anonymous Stub Migration

When running the famous migration command listed below, Laravel will make the anonymous stub migration the default behavior.

php artisan make: migration

The anonymous stub migration feature was introduced earlier to address the Github issue. Multiple migrations were causing problems for developers when they tried to recreate the database. With this new stub migration, this problem will be addressed perfectly.

<?php

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

});

}

};

New Query Builder Interface

Refactoring, static analysis, and code completion are easy and highly reliable with the new Laravel 9.7 released version. The new Query Builder Interface is highly responsive and developer-friendly. Earlier, there was a lack of shared interface between Query/Builder, Eloquent/Builder, and Eloquent/Relation. This issue has been addressed in the new version. 

PHP 8 String Functions

As the new Laravel 9.7 released version supports PHP 8, you can also use PHP 8 string functions. Some of the string functions are listed below:

str_contains(), 

str_starts_with(), 

str_ends_with() internally in the \Illuminate\Support\Str class.

Conclusion:

The new Laravel 9.7 released version is user-friendly, bug-fixing, and available with new and advanced features. For Laravel developers, this version is bliss as web development will be smooth sailing with this latest, new Laravel version.

Interested & Talk More?

Let's brew something together!

GET IN TOUCH
WhatsApp Image