Laravel 6 new features

Laravel 6.0 – Best New Features And Upgrades

Monday, 9 December, 2019 Updated on Monday, 9 August, 2021 by Eton Digital team

Laravel 6 is here! Since its release back in September, everyone has been eager to find out what’s new and improved and whether it lives up to everyone’s expectations.

If you too are looking to find out more about Laravel 6, here is what you need to know.

New branding for Laravel 6

Let’s start with something that is rather noticeable. New branding is introduced because of this new release.

Besides having a brand new website design, a new logo is introduced as well. If you are interested in finding out more about the whole process, how they came up with the new logo and what inspired them, be sure to check out their website

Laravel 6 - new branding
Source: Focus lab

Laravel 6 is the new LTS

Laravel 6 is the latest LTS (Long-term Support) version of Laravel – bug fixes will be available until September 3rd, 2021 and security fixes will be available until September 3rd, 2022. The previous two LTS were Laravel 5.1 and Laravel 5.5 (with security fixes until August 30th, 2020). If you choose to use the latest LTS version, Laravel will give you security for common vulnerabilities during this period.

Laravel takes pride in the way they include the entire community to work on security improvements. So when it comes to bug reporting, Laravel encourages active collaboration. If someone finds a bug, they should write down as much relevant information as possible, so others can replicate that bug and develop a fix. 

When it comes to security vulnerabilities, the Laravel team deals with them in a different manner.

If someone discovers a security vulnerability, they send an email directly to the team so these issues can be addressed as soon as possible. In this way, every reported issue is investigated immediately.

Semantic versioning

The Laravel packages now follow the semantic versioning standard. However, there is no need to panic, because this makes Laravel 6 compatible with other Laravel packages, since they already follow this versioning standard. 

Laravel 6 Vapor compatibility

Laravel 6 is compatible with Laravel Vapor. As you probably already know, Laravel Vapor is a serverless deployment platform for Laravel and it is powered by AWS. It allows you to monitor a variety of metrics and to manage your app’s DNS records entirely from the Vapor UI or CLI. Vapor also automatically uploads and serves your assets via S3 or CloudFront CDN for faster load times. If you want to find out more about this serverless deployment platform, make sure to check out the Vapor website

Jobb middleware

The ability to have job-specific middleware for queued jobs is a new feature, added by Taylor Otwell, who is the creator of Laravel. This new feature provides a convenient location to wrap jobs in some logic before they are executed and thanks to it, your job files are easier to read and focused on their specific tasks. However, it is worth noting that global job middleware were possible before – by calling Bus::pipeThrough([]) in a service provider during the app boot process, but this new feature will definitely make developers’ lives easier.

Lazy collections

Since Laravel’s collection methods are rather popular, Laravel 6 introduces a Lazy collection. Lazy collections leverage PHP’s generators to allow you to work with very large datasets while keeping memory usage low. So if your app needs to process extremely large log file, instead of reading the entire file into memory at once, lazy collections can be used to keep only a small part of the file in memory at a given time. This new feature allows drastic reductions in memory usage.

Ignition error page

Ignition is the default error page for Laravel 6, which contains some Laravel-specific features that should make debugging exceptions and stack traces significantly better. Apart from the debug information, Ignition makes suggestions to common problems. For example, a class or view path typo will try to provide suggested solutions and so on. 

Improved authorization process with Laravel 6

It was difficult to provide custom error messages around authorization to end users before, but Laravel 6 introduced the Gate::inspect method which provides the authorization policy’s response

$response = Gate::inspect('view', $flight);

if ($response->allowed()) {
    // User is authorized to...

if ($response->denied()) {
    echo $response->message();

Eloquent subquery enhancement

Jonathan Reinik, who is a Laravel contributor, has been an avid supporter of working more in the database layer of the Laravel apps. This is why he submitted three pull requests to Laravel to add a couple of query builder macros  to the core framework. He has been using these query builder macros to make it easier to use subqueries. These subqueries include Select, From and Order By.

Laravel UI

The biggest change regarding UI is that the front-end scaffolding is now extracted into a separate laravel/ui composer package. However, if you want the traditional scaffolding, you can easily bring it back – just run the following command:

composer require laravel/ui
php artisan ui vue --auth.

To sum up

Even though this jump from Laravel 5.8 to Laravel 6.0 is a major release, this update feels like moving from 5.8 to 5.9 (as Otwell said that himself). There aren’t that many new features and updates, which makes it easier to upgrade your projects to 6.0. 

So if you are thinking whether it is worth updating to Laravel 6 – definitely yes, it is worth upgrading to Laravel 6. You will be able to take advantage of improved features, new additions and since there will be bugfixes and security support until 2022 – you will be sure that your projects will be safe and sound.

What do you think about Laravel 6? Did it fulfill your expectations?

If you want to find out more about Laravel development and why we love using Laravel for our projects, make sure to check out our blog to get inspired. But if you are not sure which PHP framework to choose, read more about the Laravel VS Symfony duel to decide which is better for your project.

We’d love to work with you on your project!

Get in touch with us and tell us your idea.

Start a project