The New Features And Upgrades In Laravel 5.6

The New Features And Upgrades In Laravel 5.6

One of the highlights of this year’s Laracon was the announcement of Laravel 5.6, the much awaited new version of the framework.
laravel 5.6 features
This version comes with a host of improvements and builds on the successes of the previous versions. In this article, I will discuss the major highlights of Laravel 5.6, particularly
  1. New Blade Directives
  2. Logging Improvements
  3. Single Server Task Scheduling
  4. Dynamic Rate Limiting
  5. Broadcast Channel Classes
  6. API Controller Generation
  7. Eloquent Date Casting
  8. Argon2 Password Hashing
  9. UUID Methods
  10. Bootstrap 4

New Blade Directives

Laravel 5.6 have two new form directives
  • Cross-site scripting
  • HTTP method input

Log Improvements

In previous versions, the log location was config/app.php. In Laravel 5.6, logging configuration has been moved to a more logical config/logging.php file.

Single Server Task Scheduling

Scheduling task(s) for a single server has been simplified with the onOneServer() method that is used to indicate that a particular task only runs on a particular server.
Note: You must use Memcached or Redis as the default application cache driver to take advantage of single server task scheduling.

Dynamic Rate Limiting

Laravel 5.6 offers dynamic rate limiting to set up limits on per user basis:
In the above code, rate_limit is an attribute of the App\User model that determines the number of requests allowed in a given time limit.

Broadcast Channel

Now use channel classes in routes/channels.php, instead of using closures.
If  you need  generate a new channel class, Laravel 5.6 provides a new make:channel command:

API Controller Generation

Laravel 5.6 now offers API controllers that reduces the number of unnecessary create and edit actions that only return HTML. Use the following command to use API controller generation:

Eloquent Date Casting

Date formats have troubled developers using the previous Laravel versions. Realizing this, Laravel 5.6 allows developers to easily change date format as per the project’s requirements.

Password Hashing with Argon2

The Laravel Hash facade allows for both Bcrypt and Argon2 hashing for storing passwords. Argon2 is a key derivation function that was selected as the top entry in 2015 Password Hashing Competition

UUID Methods

Two new methods are now available in the Illuminate\Support\Str class for generating Universal Unique Identifiers (UUID):
orderedUuid() method will generate a timestamp first UUID for easier and more efficient database indexing.

Bootstrap 4

Bootstrap 4 is now available with Laravel 5.6. All front-end scaffolding including authentication boilerplate are now powered by Bootstrap 4.

Deprecation in Laravel 5.6

Several important areas of the framework have been deprecated. For a more detailed look into this, check out the official documentation.

Wrapping Up

Laravel 5.6 is a major improvement over the previous versions. If you have used it for your projects, do drop a comment below.