Laravel 5.3 New Features and Updates

Laracon is almost upon us. Unfortunately for me, I will not be able to attend. Guess, I'll have to wait for a couple of months to watch it on Youtube. That aside, this year's Laracon will be the stage for unveiling Laravel 5.3. Before the official release, we will look at a rundown of the new features coming to Laravel.

Since Laravel uses semver to version its releases, we know that this release is a minor release. Meaning we should expect minor features and some patches. Let's get started.

Table of Contents

This new release introduces a $loop variable inside a foreach loop. This variable provides a couple of properties that can help us easy manage indexes, increments in loops etc. Now in Laravel 5.3, we can do stuff like.

If you have ever installed a Laravel package that needs a database migration, it involves you copying some migrations into the migration folder, but with Laravel 5.3 — a package can define its migration path, and when you run php artisan migrate all migrations will run without you having to clutter your migration directory.

The query builder used to return an array. If we wanted to perform a large array of operations on the returned dataset, we would have to loop through the array. But collections makes that really simple for us to handle. So because of that reason, the query builder just like the ORM now returns a collection of objects. There is a pull request on the topic.

Laravel is bringing back the ability to customize simple navigation with views. You can also still use the pagination templates if you want, but this is still a nice feature to have. We can do stuff like this.

From the moment you publish a website, you need to be wary of security. From hackers to script-kiddies, you can’t always be sure of where the next attack could come from. So, as developers, we are always on the prowl for the next best thing when it comes to protecting our website(s)....