Home > PHP Framework > Laravel > Introduction to Laravel 7 new features and changes

Introduction to Laravel 7 new features and changes

藏色散人
Release: 2020-07-14 13:08:32
forward
3240 people have browsed it

The following is the tutorial column of Laravel to introduce you to the new features and changes of Laravel 7. I hope it will be helpful to friends in need!

Introduction to Laravel 7 new features and changes

Laravel 7 is a non-LTS version. Currently, only Laravel 6 and 5.5 are LTS versions.

Route Caching Speed ​​Up

Improving the performance of Laravel is a top priority. Laravel 7 claims to have improved the speed of Route Caching.

Taking the simplest Hello World as an example, the speed is increased by twice. However, it is a drop in the bucket.

Built-in HTTP Client

It is actually an encapsulation of Guzzle. This is much more convenient. You no longer need to manually import Guzzle.

use Illuminate\Support\Facades\Http;

$response = Http::post('url', [
    'name' => 'Laravel',
]);

echo $response['foo'];

$response->body()
$response->json()
$response->status()
Copy after login

Customized Eloquent Casts

I have no need for this yet, the built-in cast type already meets my needs.

Laravel Airlock

An API authentication system designed for single-page applications and mobile APPs. A single user can generate multiple tokens at the same time.

It’s useless. Before Laravel can’t solve the performance problem, who will use Laravel to provide API services.

String chain operation

return (string) Str::of('  Laravel Framework 6.x ')
                    ->trim()
                    ->replace('6.x', '7.x')
                    ->slug();
Copy after login

Summary

Overall, I still have no urge to upgrade Laravel 7, after all, it is a non-LTS version. Moreover, the current scenarios for using Laravel are mostly multiple web projects on one server, and upgrading many historical projects is of little significance.

The above is the detailed content of Introduction to Laravel 7 new features and changes. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
git
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template