X
    Categories: Learn Laravel Tutorials, Tips And Guides

Laravel 5.5 is out – Check out the good stuff

Taylor Otwell has recently announced Laravel  Horizon and  Laravel 5.5 is also released. The Laravel community is pretty excited about the new features of the new version. In this short article, I am going to cover several of these new features and will attempt to highlight their importance and benefit.

Let’s get started.

PHP 7 now a Pre-Req

The support for PHP 5.5 has already ended and the security support for 5.6 is going to end in 2018. As with Symfony 4, Laravel 5.5 will also requires PHP 7.0 at the minimum.

LTS Release

Laravel 5.5 will be going to be the next LTS release after Laravel 5.1. This release will include two years of bug fixes and three years of security patches.

“Vendor:publish” Get’s Provider Prompt

Now when you run the command “php artisan vendor:publish” you will get a prompt in your timeline to choose which provider you need to publish. Here is a GIF highlighting the process:

Via Laravel News.

Render Mailable to Browsers

In Laravel 5.5, you can render mailable directly in your browser for testing by creating a route for it.

Support for Email Themes in Mailable

Laravel 5.4 offers markdown mailable but there was no option for customization. In Laravel 5.5 you can use your custom styles for emails.

Laravel Migrate Fresh Command

Laravel 5.5 comes with a new migrate command “migrate:fresh”. This command will first drop all the tables and then migrate them all.

Frontend Presets

In Laravel 5.5, a new command  “presets” is added, through which you can replace the default frontend like VueJS with any other frontend framework (React, for instance). You could also use this command to remove the frontend JS framework if you don’t need one.

Request Data From Validation

Laravel 5.5 will now return the request data after validation. Now you can directly save the data after validation.

public function store(Request $request)

{

   $data = $this->validate($request,[

               'todo' => 'required',

               'description' => 'required',

               'category' => 'required'

           ]);



   // $data = request()->only('name', 'price', 'category_id');

   return Todo::create($data);

}

Custom Validator Rules

With Laravel 5.5, you can create your custom validation. Taylor Otwell has written a great tutorial on the topic.

Blade::if Directives

With Laravel 5.5, comes a new directive for Blade templating engine, `Blade::if()`. If you want to learn more about it, Laracast has a video on the topic.

Conclusion

In addition to the above-mentioned features, Laravel 5.5 comes with a host of awesome features that could make the lives of Laravel developers a lot easier. Check out the official announcement for more details.

Ahmed Khan: Ahmed was a PHP community expert at Cloudways - A Managed PHP Hosting Cloud Platform. He is a software engineer with extensive knowledge in PHP and SEO. He loves watching Game of Thrones is his free time. Follow Ahmed on Twitter to stay updated with his works. You can email him at ahmed.khan@cloudways.com