Press "Enter" to skip to content

Laravel 5.6 new features

Following are the list of new features in Laravel 5.6:-

  1. Blade component improvements

2. Double encoding by blade

By default, Blade will double encode HTML entities. Related to some weird issues from Twitter. Click here to know more. To disable, simply add the Blade::withoutDoubleEncoding method to any boot method of your service providers:

3. An alternative to bcrypt is available. It is called Argon2.

Argon2 is a password-hashing function that summarizes the state of the art in the design of memory-hard functions and can be used to hash passwords for credential storage, key derivation, or other applications.

However, it requires php7.2 or greater.

4. Removal of php artisan optimize command.

Version 5.6 or laravel will remove the optimize command that was deprecated in laravel 5.5. Composer already provides the better option now. So, this command is not required anymore.

5. Two new blade directives.

Laravel 5.6 adds few much-needed blade directives.

Click here to learn how to add your own directives.

7. Dynamic rate limit

8. Eloquent date casting

Since Laravel 5.5 you can cast Eloquent attributes. The common example here is when you save a boolean like value with 0 and 1 in the database, but in your application you want that attribute to be a real boolean. In order to do that you can cast that value inside your model.

First, select the attribute in the key field. Then start the value with the data type (date or datetime), following a semicolon and the date format you want it to be.

Everything is awesome.