Laravel community has updated about the new release of another version of Laravel called laravel 9. With laravel 9 it brings new features that you will love and it will be released earlier next year in 2022 due to some dependencies of Symphony they depend on which will be available by November 2021 and Laravel normally gives 2 months after symphony updates to release a new version of laravel.
Let's look at the new features
Laravel introduced a new query builder which helps you easily get more data from the Model without writing a lot of codes
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
});
Other new features of Laravel 9 are Anonymous Stub Migrations
These new features will be default features coming to Laravel
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();
});
}
};
David Enabs
Hmm..!
This will be cool