10 June, 2015

Laravel 5.1 is Released

Laravel has just announced the immediate availability of v5.1. This marks the first release in Laravel’s history to offer long-time support. Let’s look at some of the new features and also learn more about it.

Long Term Support

Since originally launching in 2011, Laravel has always followed the "release early, release often" mantra which is popular in open source applications. With the historic rise in popularity of the framework, it was time to start focusing on the needs of large organizations and mission-critical applications that need security fixes but can’t upgrade quickly. Laravel 5.1 will now include 3 years of security fixes.
The long-term support is arguably the biggest feature in 5.1, but it includes several other new features.

Commands

The second big change is the “Commands” folder is being renamed to “Jobs” to indicate it’s primarily for queued jobs. This folder change will not be a backwards compatibility break.

New Documentation

The documentation has been completely reworked to offer more clarity, to be more in-depth, and to have a nicer flow. This was a huge undertaking and countless hours was spent fine-tuning each page.

Taylor said he would delay an entire Laravel release rather than release something with poor documentation, when asked if spending this much time on it was worth it. Another new documentation feature is real-time search with auto-complete.





PSR-2

The app and generators are converting to PSR-2. If you are not familiar with PSR-2, it’s a Coding Style Guide. The biggest change from current Laravel style is tabs to spaces and control structures will now go on the same line.

Resolve a service from blade

You can now resolve a service directly from a Blade Template:

extends('layouts.app')inject('stats','StatisticsService')

<div>{{$stats->getCustomerCount()}}</div>


Envoy runs local SSH scripts

Finally, and this is available now, Envoy allows you to run local scripts without SSH. See this pull request for more details. To get the latest version just run:

global

Middleware Parameters

This new feature allows you to pass parameters into the middleware. Here is a screenshot of a demo:




Broadcasting Events

Laravel already included a powerful event system and this new feature builds on that by allowing you to broadcast events over a websocket so your client can consume them. With this new feature, it makes creating real-time applications simple.

Better Application Unit Testing

With an inclusion of Laracasts integrated testing package testing your application is going to be easier than ever before.


public function testNewUserRegistration(){

$this->visit('/register')->type('Taylor','name')->check('terms')->press('Register')->seePageIs('/dashboard');

}

CSRF Except

In Laravel 5.0 all requests are ran through the CSRF middleware and this is great for most use cases. However, one gotcha is using services with web hooks where you do not have the ability to set a token. A new feature in 5.1 is an except property on the VerifyCsrfToken class which will allow this to be easily over-ridden.

protected$except=['webhook/*'];


Where to go next

Head over to the new official documentation which includes everything you need to know about installation, upgrading, and all the framework features.

#laravel #laravel5.1 #laravel_new_release

No comments:

Post a Comment