Get a Free Quote
Our Blog

What’s New in Laravel 5.6 ? [ Complete Guide ]

Tarun Bansal
February 06, 2018

Laravel 5.6 will be released in February 2018. Below mentioned are some new features that will come along, with the latest update. Here, in this article, you will find the detailed information about these new features. These can be highly helpful to you if you are a Laravel Development Service provider.

  • Two New Blade Directives
  • Remove Artisan Optimize command in Laravel 5.6
  • Laravel 5.6 will Support the Argon2i Password Hashing Algorithm
  • Laravel 5.6 adds the Collision Package for CLI Error Reporting

1) Two New Blade Directives

Laravel 5.6 will include two new blade directives one for cross-site request forgery (CSRF) token in your html forms and other request as well.

In Laravel 5.5 we are using below method to form hidden files and for csrf token and another hidden input as well.

<form method="POST">
{{ csrf_field()}}
{{ method_field("DELETE")}}
<!-- ... -->
</form>

Laravel 5.6 you will be used below.

<form method="POST">
@csrf
@method("DELETE")
<!-- ... -->
</form>

In Laravel, it’s necessary to use csrf protection in your application every HTTP request, you must include a csrf token in hidden files like _token to save. Laravel 5.6 you need to do just @csrf.

You can not declare any PATH, PUT or DELETE requests in HTML forms. You need to add just hidden _method field to tell Laravel HTTP request.

2) Remove Artisan Optimize command in Laravel 5.6

php artisan optimize command was deprecated as of Laravel 5.5, After the official release of Laravel 5.6, it is removed.

In Laravel 5.5, the composer.json in your applications root folder no longer references optimize in the post-install-cmd and post-update-cmd scripts. In Laravel 5.6 you can not used optimize command in your applications.

In Laravel 5.5 use of optimize command generates a deprecated warning and now after the release Laravel 5.6 it is completely removed. So once you are update to Laravel 5.6 be sure to remove the command from your composer.json.

3) Laravel 5.6 will Support the Argon2i Password Hashing Algorithm

The Argon2i password hashing support will be supported by Laravel 5.6 (require php 7.2).

Before compiling PHP, you need to install the argon2 library. If you are using a Debian/Ubuntu Linux distribution, you can run the following command:

sudo apt install argon2 libargon2-0 libargon2-0-dev

To compile PHP, you need to extract the previous source code in a folder and run the following commands:

./configure –with-password-argon2
make
make instal

Argon2 is a password-based key derivation function winner of the Password Hashing Competition in July 2015.

This function is an evolution of the bcrypt and scrypt algorithms.

Argon2 provides security against brute force attacks using a predefined memory size, CPU time, and a degree of parallelism to prevent GPU attacks.

It uses 3 parameters that control the memory requirements, the execution time, and the parallelism level.

There are two main versions of this algorithm: Argon2i and Argon2d. Argon2i is the safest against side-channel attacks, while Argon2d provides the highest resistance against GPU cracking attacks.

Argon2d is not suitable for password hashing and should not be used.

4) Laravel 5.6 adds the Collision Package for CLI Error Reporting

Collision Package created and maintained by Nuno Maduro an error handler package for PHP command line applications. This package gives you beautiful error reporting once you interacting with your Laravel applications through command line or CLI.

You will get error reporting in your terminal like this:


Laravel 5.5 is built on the top of the Whoops error handler and it’s supports artisan and PHPUnit. Please check Collision Github repo for more information about this package.

Hire Laravel Developer From Elsner to get the finest experience of laravel development.