In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what the new features of Laravel version 6.0 are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The Laravel team today announced the official release of Laravel version 6.0, which marks the beginning of a semantic version of the Laravel framework, which also includes support for Laravel Vapor, optimized authorization responses, task middleware, lazy collections, subquery optimization, and many other detail optimizations.
Here are some new features about the Laravel version 6.0:
New version of LTS
Laravel 6.0 is a new version of LTS, bug fixes will last until September 3, 2021, and security fixes will continue until September 3, 2022. The last version of LTS was Laravel 5.5, which was released two years ago (the security fix will continue until August 30 next year).
Semantic version
The release notes for Laravel have already described the use of semantic versions of Laravel 6.0 and beyond:
The Laravel framework (laravel/framework) package now follows the semantic versioning standard. This makes the framework consistent with the other first-party Laravel packages which already followed this versioning standard. The Laravel release cycle will remain unchanged.
Optimize authorization response
Previously, it was difficult to provide custom error messages to end users around authorization features, and Laravel 6.0introduced the Gate::inspect method to authorize policy responses:
$response = Gate::inspect ('view', $flight); if ($response- > allowed ()) {
/ / the user has authorized.} if ($response- > denied ()) {
/ / the user is not authorized. A response message is returned.
Echo $response- > message ();}
Based on this method, we can easily return custom response messages to the end user.
Task middleware
Tasks here refer to queue tasks, and task middleware allows you to apply middleware to queue tasks to filter them:
/ / you can define the middleware method in the task class to specify the middleware public function middleware () {
Return [new SomeMiddleware];} / / you can also specify the middleware SomeJob::dispatch ()-> through ([new SomeMiddleware]) through the through method when distributing tasks.
The use of middleware can avoid writing check logic independent of the subject business logic in the handle method of the task class, reduce the coupling of the code and improve the reusability of the code.
Lazy set
Lazy sets are game changers that deal with large amounts of collection data, including Eloquent model collections. Laravel 6.0introduces a new Illuminate\ Support\ LazyCollection class to deal with large data sets, and the underlying PHP generator is used to ensure that low memory usage can be maintained even if the amount of data is large. We will describe this feature in more detail later in the collection documentation.
Eloquent subquery enhances Laravel UI
The front-end scaffolding provided by Laravel 5.x has now been ported to a separate laravel/ui expansion package so that we can split the UI scaffolding from the main frame and iterate independently.
If you want to continue using the traditional Bootstrap/Vue scaffolding, you can run the following command:
Composer require laravel/ui
Php artisan ui vue-auth above is all the content of the article "what are the new features of Laravel version 6.0.Thank you for reading!" I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.