Stable Release in branch 6.0 (LTS)
6.20.1
Released 11 May 2021
(5 years ago)
SoftwareLaravel
Version6.0 (LTS)
StatusLTS
End of life
Supported
PHP versions
PHP 7.2 - 8.0
Initial release6.0.0
27 Aug 2019
(6 years ago)
Latest release6.20.1
11 May 2021
(5 years ago)
End of bug fixes03 Sep 2021
(Ended 4 years ago)
End of security fixes03 Sep 2022
(Ended 3 years ago)
Release noteshttps://github.com/laravel/laravel/releases/tag/v6.20.1
Source codehttps://github.com/laravel/laravel/tree/v6.20.1
Documentationhttps://laravel.com/docs
Downloadhttps://laravel.com/docs/master/installation
Laravel 6.0 (LTS) ReleasesView full list

What Is New in Laravel 6.0

Laravel 6.0 is a landmark release introducing semantic versioning and a suite of new first-party components. It focuses on refining the developer experience with improved tooling and application scaffolding.

Category Key Changes
New Features Semantic Versioning, Laravel UI, Job Middleware, Lazy Collections, Eloquent Subquery Enhancements
Improvements Ignition Error Page, Authorization Responses, Exceptions in Mailables
Deprecations Artisan Optimize Command

Why did Laravel adopt semantic versioning?

Laravel 6.0 marks the shift to semantic versioning, bringing clearer expectations for future updates. This means major framework releases will now be tagged as 7.0, 8.0, etc., with minor and patch releases in between. In practice, this provides a more predictable and stable release cycle for developers planning long-term projects.

What is the new Laravel UI package?

The frontend scaffolding has been extracted into a separate laravel/ui Composer package. This change allows the core framework to focus on backend features while providing more flexibility for frontend setups. To generate authentication scaffolding, you now use commands like php artisan ui vue --auth instead of the old make:auth.

How do job middleware work?

Job middleware allow you to wrap custom logic around the execution of queued jobs. This is perfect for tasks like rate limiting or logging. You define middleware using the handle method and attach them to a job via its middleware method.

// Defining a middleware
class RateLimited
{
    public function handle($job, $next)
    {
        Redis::throttle('key')->allow(10)->every(60)->then(function () use ($job, $next) {
            $next($job);
        }, function () use ($job) {
            $job->release(60);
        });
    }
}

// Attaching it to a job
public function middleware()
{
    return [new RateLimited];
}

What are lazy collections?

Lazy collections let you work with very large datasets while keeping memory usage low. They use PHP generators under the hood to process data in chunks. This is a game-changer for commands or jobs that need to process millions of database records without running out of memory.

// Using a lazy collection for a massive dataset
$users = App\User::cursor()->filter(function ($user) {
    return $user->id > 500;
});

foreach ($users as $user) {
    echo $user->id;
}

What Eloquent subquery enhancements were added?

Eloquent gained the ability to add subqueries to your selects, providing more power for crafting efficient queries. You can now select related data from other tables in a single query, which often eliminates the need for N+1 query problems.

// Adding a subquery to a select
$posts = Post::addSelect(['last_comment' => Comment::select('body')
    ->whereColumn('post_id', 'posts.id')
    ->latest()
    ->limit(1)
])->get();

What improved error pages come with Laravel 6.0?

Laravel 6.0 ships with Ignition, a completely redesigned error page that offers better debugging UX. It provides improved stack traces, code editing suggestions, and exception sharing. This matters because it significantly speeds up the debugging process during development.

FAQ

Is the `artisan optimize` command still needed?
No, the `optimise` command was removed as it's no longer necessary for performance in modern PHP applications. The framework automatically handles optimization internally.

How do I upgrade my existing Laravel 5.8 project to 6.0?
Update your `laravel/framework` dependency to `^6.0` in composer.json and run `composer update`. You'll also need to review the upgrade guide for specific changes like the new Laravel UI package if you use frontend scaffolding.

What happened to the `arr_` and `str_` helper functions?
They are still available but are now implemented using `Illuminate\Support\Arr` and `Illuminate\Support\Str` classes. You don't need to change your code as the helpers continue to work exactly as before.

Can I still use the old error page instead of Ignition?
Yes, though it's not recommended. You can install the `filp/whoops` package to revert to the previous error handler, but you'll miss out on the enhanced debugging features.

Are there any new requirements for Laravel 6.0?
Yes, Laravel 6.0 requires PHP 7.2 or later. Make sure your server environment meets this requirement before attempting an upgrade.

Releases In Branch 6.0 (LTS)

VersionRelease date
6.20.111 May 2021
(5 years ago)
6.20.030 Oct 2020
(5 years ago)
6.19.029 Oct 2020
(5 years ago)
6.18.3511 Aug 2020
(5 years ago)
6.18.816 Apr 2020
(6 years ago)
6.18.324 Mar 2020
(6 years ago)
6.18.024 Feb 2020
(6 years ago)
6.12.014 Jan 2020
(6 years ago)
6.8.016 Dec 2019
(6 years ago)
6.5.221 Nov 2019
(6 years ago)
6.4.021 Oct 2019
(6 years ago)
6.2.008 Oct 2019
(6 years ago)
6.0.210 Sep 2019
(6 years ago)
6.0.103 Sep 2019
(6 years ago)
6.0.027 Aug 2019
(6 years ago)