Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of Laravel 5.8?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the new features of Laravel 5.8. it has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.

Laravel 5.8is now officially available to everyone. This version includes several new features as well as the latest bug fixes and improvements to the core of the framework.

Some new features are as follows:

PHP dotenv

Laravel 5.8integrates PHP's dotenv 3.0. here are the new features of PHP dotenv 3.0:

Greater flexibility in reading and changing environment variables

First-class support for multiline variables

Instead of formatting values, the values you get are what they are now.

Dotenv files can be found on multiple lines in sequence. Previously, only one line was supported.

Stronger verification of variable names to avoid errors caused by static or fuzzy variables

Support for Carbon 2.0

Carbon 1.0 or Carbon 2.0 can be used on Laravel 5.8, including CarbonImmutable or even CarbonImmutable by default. Localization Carbon 2.0 has changed a lot, and version 2.0 provides more friendly internationalization support than version 1.0. For more information. Upgrade of Carbon class on Laravel 5.8.

Changes in Cache TTL

The major change that could have a medium to high impact is the change in Cache TTL from Laravel 5.8. Now the method of passing integers to the cache has been changed from minutes to seconds. If you want to change the integer to an Carbon or\ DateInterval instance during the migration process, please check out my article.

Deprecated string and array helper functions

Don't worry too much about this modification, although the use is changed to a class, but the specific method of use is the same as before. And Laravel has plans to release Helper as an optional expansion pack, and you can still use them in your project.

Reference: Laravel 5.8 deprecated string and array helper functions

Automatic parsing strategy

Starting with Laravel 5.8, as long as the resolution policy and model are in the traditional location, you do not need to register them in the AuthServiceProvider class.

If you prefer to use unconventional paths for models and resolution policies, you can register callbacks to register policies or continue to manually configure them:

Gate::guessPolicyNamesUsing (function ($class) {

/ / Do stuff

Return $policyClass;})

More related information: Laravel 5.8 will support automatic parsing of authorized Policy classes

More New Featur

Nexmo and Slack information notification channel

Blade template file path

Changes to the directory of Markdown files

With today's release, Laravel 5.7 will no longer receive feature bug fixes and updates. However, 5.7 security updates will be received by August 2019.

Laravel 5.8 is the latest stable version and will handle bug fixes and updates received around August 2019 and security fixes by around February 2020.

Thank you for reading this article carefully. I hope the article "what are the new features of Laravel 5.8" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report