
As on September 3rd, 2019 Laravel Framework development team has officially announce the release of new version of laravel which Laravel 6 and it is LTS (Long-term support).
New laravel 6 is now available to everyone along with the documentation about release notes and upgrade guide from 5.8 to 6, upgrading from laravel 5.8 to 6 will take around one hour depending on feature your using into your existing laravel 5.8 application.
This new release of the Laravel framework (laravel/framework) using Semantic Versioning. Also, this release includes compatibility with Laravel Vapor, it has improved authorization responses, job middleware, lazy collections, sub-query improvements, along with many other major improvements.
Recommended – Develop Exclusive Laravel 6 CRUD Application with Input Validations
Here is the list of the new features included in Laravel 6:
Table of Contents
New LTS Release
As I told in the beginning of this tutorial, Laravel 6 is LTS release meaning it has long term support policy included, it will support bug fixes for 2 years until September 3rd, 2021 and security fixes for 3 years until September 3rd, 2022.
Laravel 6 has provided the longest time of support and maintenance possible, and for general releases bug fixes are only support for 6 months and security fixes for 1 year.
Here’s the release table with versions and dates:
Version | Release | Bug Fixes Until | Security Fixes Until |
6.0 (LTS) | Sep 3rd, 2019 | Sep 3rd, 2021 | Sep 3rd, 2022 |
5.8 | Feb 26th, 2019 | Aug 26th, 2019 | Feb 26th, 2020 |
5.7 | Sep 4th, 2018 | Mar 4th, 2019 | Sep 4th, 2019 |
5.6 | Feb 7th, 2018 | Aug 7th, 2018 | Feb 7th, 2019 |
5.5 (LTS) | Aug 30th, 2017 | Aug 30th, 2019 | Aug 30th, 2020 |
5.4 | Jan 24th, 2017 | Jul 24th, 2017 | Jan 24th, 2018 |
5.3 | Aug 23rd, 2016 | Feb 23rd, 2017 | Aug 23rd, 2017 |
5.2 | Dec 21st, 2015 | Jun 21st, 2016 | Dec 21st, 2016 |
5.1 (LTS) | Jun 9th, 2015 | Jun 9th, 2017 | Jun 9th, 2018 |
5.0 | Feb 4th, 2015 | Aug 4th, 2015 | Feb 4th, 2016 |
Semantic Versioning
From now Laravel framework package and all it’s upcoming releases will follow the semantic versioning standards according to the laravel documentation. It will make the framework release more consistent with the first-party Laravel packages which already where following this standard.
Improved Authorization Responses
With laravel older versions like 5.* it was little bit difficult to provide custom error messages while implementing authorization process, now Laravel 6 has come up with Gate::inspect method which is going to provide the authorization policy’s response, here how we can provide custom response message to the laravel authorization process.
Example of Laravel Custom Authorization Responses:
$response = Gate::inspect('view', $flight);
if ($response->allowed()) {
// User is authorized to view the flight...
}
if ($response->denied()) {
echo $response->message();
}
Job Middleware
As name suggest job middleware are basically, jobs those are going to run through middleware.
So we can create a job which we want to run through middleware and we can specify the middleware into the job using middleware() method, like showing below:
use App\Jobs\Middleware\MyCustomMiddleware;
// a middleware method for job class
public function middleware()
{
return [new MyCustomMiddleware];
}
You can also specify middleware when we dispatch the job, here is simple example:
MyJob::dispatch()->through([new MyCustomMiddleware]);
Recommend – How to Create Configure and Use Laravel Custom middleware in Laravel 5.8
Improved Exceptions Page Via Ignition
Laravel 6.0 comes with the Ignition, Ignition will provide new beautiful, more developer friendly UI and improved Exception page.
Here is the example of new Exception page:

Lazy Collections
Lazy collections is going to be an outstanding feature while working with extensive collections of data, including Eloquent model collections.
New Illuminate\Support\LazyCollection
class leverages PHP’s generators to keep memory low while working with large datasets.
For example, if we needs to process a multi-gigabyte, so Instead of reading it at once into memory lazy collections will allow us to keep only a small part of the file in memory at a given time.
You can learn more about lazy collection to increase speed and performance of laravel application – Practical Useful Examples of Using Laravel 6 Lazy Collection Class
Eloquent Subquery Enhancements
Laravel 6.0 comes with new enhancements and improvements to database subquery in Eloquent ORM.
So with laravel 6 we can basically use models class names to execute queries to the database.
Here is how we can apply sub queries using model class:
return Destination::addSelect(['last_flight' => Flight::select('name')
->whereColumn('destination_id', 'destinations.id')
->orderBy('arrived_at', 'desc')
->limit(1)
])->get();
Recommend – Complete guide of using Laravel 6 Eloquent Subquery Enhancements
Laravel UI
The frontend scaffolding which was included in Laravel 5.x releases is now extracted into a separate laravel/ui Composer package. This allows first-party UI scaffolding to be iterated on separately from the primary framework.
So important note here, no Bootstrap or Vue code is present in default laravel 6 framework scaffolding, and the make:auth
command has been extracted from the framework as well.
If you want the Traditional Bootstrap/Vue/ scaffolding, you can do tthat using following command:
composer require laravel/ui
php artisan ui vue --auth
Get complete steps on using Laravel UI package to – Configure Bootstrap Vue React in Laravel 6 with make auth
Laravel Vapor Compatibility
Laravel 6 comes with compatibility with Laravel Vapor, Vapor provides auto-scaling serverless deployment platform for Laravel.
Vapor abstracts the complexity of managing Laravel applications on AWS Lambda, as well as interfacing those applications with SQS queues, databases, Redis clusters, networks, CloudFront CDN, and more.
Want to create new Laravel 6 application?
From now with Laravel CLI you will be able to create a new Laravel 6 application, as showing below:
laravel new my-app

Here are list of documentation guide which you can check from Laravel official website
Enjoy creating awesome applications with laravel 6.
Browser all available tutorial in Laravel here on iTech Empires – Laravel Tutorials