📜 ⬆️ ⬇️

Laravel 5.1

image

Laravel announced the release of version 5.1. This is the first release in Laravel history to offer long-term support. Let's look at some of the new features of framemaker.

Long term support.

So, initially launching Laravel in 2011, the framework followed, like many popular opensource projects, the mantra “ release earlier, release more often ”. With the historically growing popularity of the framework user, it is time to focus on the demands of large organizations and mission-critical applications that need secure patches, without any quick updates. Laravel 5.1 now includes 3 years of secure fixes.
')
Long-term support is probably the biggest feature in 5.1, but the release includes other innovations.

New documentation.
The documentation has been completely redesigned, and presented more clearly, more detailed and enjoyable. This was a great achievement, many hours were spent to fine-tune each page.

When Taylor was asked: “Was it worth spending so much time on documentation?”, He replied that it would be better to delay the release of Laravel 5.1 than to release it with bad documentation. Another new feature is online search.
image

PSR-2.
The biggest changes from the current Laravel style were to the replacement of tabs with spaces, and attention was also paid to the management structures, which are now located on the same lines.

Commands.
The second big change was the renaming of the " Commands " folder to " Jobs " to indicate that they are primarily used for job queues.

Work with services from templates.
Now you can use the service directly from the template:
@extends('layouts.app') @inject('stats', 'StatisticsService') <div>{{ $stats->getCustomerCount() }}</div> 


Envoy also runs local SSH scripts.
Finally, Envoy allows you to run local scripts without SSH.

Middleware options.
This new feature allows you to transfer parameters in middleware.
image

Broadcasting events.
Laravel already contains a powerful event system that allows you to broadcast events via websocket , so that the client can receive them. With this new feature, creating applications in real time has become easier.

CSRF exceptions.
In Laravel 5.0, all requests passed through CSRF-middleware , and this is acceptable for most cases. However, when using the service with web-hooks , you do not have the ability to set a CSRF token. A new feature in 5.1 is the introduction of the excluding property of the VerifyCsrfToken class, which makes it easy to redefine the routes for using this middleware:
  protected $except = [ 'webhook/*' ]; 


Improved unit testing applications.
With the inclusion of a comprehensive testing package, the process of writing unit tests for an application will become easier than before:
  public function testNewUserRegistration() { $this->visit('/register') ->type('Taylor', 'name') ->check('terms') ->press('Register') ->seePageIs('/dashboard'); } 


Elixir-improvements.
They promise ECMAScript 6 support in Elixir out of the box.

Source: https://habr.com/ru/post/259955/


All Articles