Home >PHP Framework >Laravel >Laravel 6.0 LTS released with update details
The Laravel team has announced the official release of Laravel 6.0 on September 4, 2019. The release of this version marks the laravel framework starting to use semantic version, in addition, this version also includes support for Laravel Vapor , optimized authorization response, task middleware, lazy collection, subquery optimization and many other detailed optimizations.
The following are some new features about Laravel 6.0 version:
Laravel 6.0 is the new LTS version
The release of Laravel 6.0 marks the new release of Laravel The LTS (Translator's Note Long-Term Support) version, the bug fixes of this version will last until September 3, 2021, and the security fixes will last until September 3, 2022. Previous LTS version Laravel 5.5 (security fixes until August 30, 2020). The following is the update table for the latest version of Laravel and the date of the latest version:
Semantic version number
Laravel release notice clarifies Semantic control for Laravel 6.0 and later versions:
Laravel framework (Laravel /framework) package follows the Semantic Versioning standard. This keeps the framework consistent with other first-party Laravel packages that already follow this versioning standard. Laravel's release cycle will remain unchanged.
Optimize authorization response
Before this, it was very difficult to provide custom error messages to end users around authorization policies. Laravel6 provides the Gate::inspect method to authorize policy responses. :
$response = Gate::inspect('view', $flight); if ($response->allowed()) { // 用户已授权... } if ($response->denied()) { // 用户未授权,返回响应信息 echo $response->message(); }
Task middleware
Task middleware allows middleware to filter queue tasks:
// 在任务类中定义中间件方法 public function middleware() { return [new SomeMiddleware]; } // 分发任务时可通过through指定中间件 SomeJob::dispatch()->through([new SomeMiddleware]);
Using middleware can avoid Write code that has nothing to do with the main business logic in the handle() method of the task class.
Lazy Collections
Lazy collections are a game-changer for collections that deal with large amounts of data (including Eloquent model collections). A new lighting \Support\LazyCollection class leverages PHP's generators to keep memory low when working with large data sets. Check out the Lazy Collections documentation for more details on this impressive new feature!
Eloquent Subquery Enhancements
Learn more about Jonathan Reinink's contributions to subqueries, see his post on Laravel News Article – Great subquery enhancements in Laravel 6.0. Also, check out Jonathan's great talk on using subqueries (among other techniques) in his Laracon talk Eloquent Performance Patterns.
Laravel UI
The front-end scaffolding that comes with Laravel 5.x is now separated into an independent laravel/ui Composer package. This allows for easy iteration of UI scaffolding outside of the main framework.
If you want to build with traditional Bootstrap/Vue/, you will run the following command:
composer require laravel/ui php artisan ui vue --auth
Learn more
You can use it now The laravel CLI tool starts a new Laravel 6 application:
laravel new my-app
For more Laravel related technical articles, please visit the Laravel Framework Getting Started Tutorial column to learn!
The above is the detailed content of Laravel 6.0 LTS released with update details. For more information, please follow other related articles on the PHP Chinese website!