Laravel 6 – A Look At What’s New Coming

Laravel 6 - A Look At What's New Coming

In this article, we are going to look at some of the new features that have been included/excluded in Laravel 6 and how you can take advantage of them in your application. We are going to be looking at them in no particular order. Let’s get started.

Laravel 6 Long Term Support Release

Laravel 6 is the continuity of the Laravel 5.8 with some improvements and bugs fixes. Taylor Otwell announces that Laravel 6 will be an LTS (Long Term Support) release, previously Laravel 5.5 was the LTS release.

LTS means Long Term Support. This version of Laravel will get bug fixes for two years and will get an additional year of security updates.

Semantic Versioning (SemVer)

From Laravel 6 onward, Laravel will follow the semantic version standard. This will also apply to the other Laravel’s packages like Cashier, Mix, Dusk and so on.

Carbon 1.x No Longer Supported

From Laravel 6 onward, Carbon 1.x is no longer supported. When you upgrade your existing Laravel application, you have to upgrade Carbon 1.x to Carbon 2.0.

Laravel UI

In the previous versions of Laravel we get the authentication scaffold out of box which generate the required views and other files. In Laravel 6, all frontend presets has been extracted to a seprate Composer package called laravel/ui and also the command make:auth has been extracted as well.

No Bootstrap or VueJS presets are available in the default framework scaffolding.

If you are willing to use the Laravel UI package, then you can run the below command to require the laravel/ui package.

composer require laravel/ui

To generate the UI scaffold, you can use the below command:

php artisan ui vue --auth

String & Array Helpers Package

The str_* and array_* helper functions have been removed in the Laravel 6 release. These helper functions have been ported to the separate package called laravel/helpers. Just like Laravel UI, you can require this package if you are still willing to use these functions.

composer require laravel/helpers

If you don’t want to install a seprate package for this, then during the upgrade process you have to update all str_* and array_* functions with the Illuminate\Support\Str and Illuminate\Support\Arr classes respectively.

Job Middleware

In Laravel 6, job middleware is introduced which helps you to write custom logic around the execution of your queued jobs. You can read more about how you can utilize this new feature of Laravel 6 on the release documentation page.

Lazy Collections

Laravel Collections are one of our favorite feature which makes Laravel different from other many PHP frameworks. In Laravel 6, Lazy Collections has been introduced which helps you to work with large datasets while keeping the memory usage low.

You can read more abour how you can utilize this new feature of Laravel 6 on the release documentation page.

Eloquent SubQuery Enhancement

In Laravel 6 Eloquent SubQueries are enhanced which helps you to run multiple queries on our models. Using the new subquery select functionality in Laravel 6.0, you can select a record based on the subquery.

You can read more abour how you can utilize this new feature of Laravel 6 on the release documentation page.

Laravel Vapor Compatibility

Taylor Otwell announced the Laravel Vapor at Laracon US 2019 event.

Laravel Vapor is a serverless deployment platform for Laravel, powered by AWS. Launch your Laravel infrastructure on Vapor and fall in love with the scalable simplicity of serverless.

Laravel 6 provides the compatibillity with the Laravel Vapor.

Conclusion

Laravel 6 has not been released yet (at the time of writing this post), but you can install it using the below command.

laravel new app --dev

On the release page of Laravel 6, you can find the official release date of Laravel 6 which is September 3rd, 2019.

To learn more about the Laravel 6.0 release, including the highlights of new features and changes introduced, check out the Laravel 6.0 Release Notes Documentation.

2 comments on “Laravel 6 – A Look At What’s New Coming

Leave a Reply

Your email address will not be published. Required fields are marked *

*

When sharing a code snippet please wrap you code with pre tag and add a class code-block to it like below.
<pre class="code-block">you code here</pre>

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.