Laravel 7.2 发布

栏目: 软件资讯 · 发布时间: 5年前

内容简介:Laravel 7.2 发布了,此版本包含 HTTP 客户端查询字符串支持和 SMTP 邮件驱动程序的新超时配置选项。 主要新特性有: ExpectsConfirmation 测试方法 用于测试 artisan 命令的 PendingCommand 类上的 ExpectsConfi...

Laravel 7.2 发布了,此版本包含 HTTP 客户端查询字符串支持和 SMTP 邮件驱动程序的新超时配置选项。 

主要新特性有:

ExpectsConfirmation 测试方法 

用于测试 artisan 命令的 PendingCommand 类上的 ExpectsConfirmation() 方法: 

$this
->artisan(
'foo:bar'
)
    ->expectsConfirmation(
'Do you want to continue?'
, 
'no'
)
    ->assertExitCode(
1
);

SMTP 邮件驱动程序超时

SMTP 邮件驱动程序现在有了超时配置。默认值为 30 秒。如果要调整默认值,请以秒数为单位添加自定义超时配置: 

'timeout'
 => 
60
, 
// seconds

支持 HTTP 客户端查询字符串

这意味着可以将第二个参数传递给 Http::get() 

这是一个工作原理示例: 

Http::get(
'https://example.com/get'
);

// URL: https://example.com/get


Http::get(
'https://example.com/get?abc=123'
);

// URL: https://example.com/get?abc=123


Http::get(
'https://example.com/get'
, [
'foo'
 => 
'bar'
]);

// URL: https://example.com/get?foo=bar


Http::get(
'https://example.com/get'
, 
'foo=bar'
);

// URL: https://example.com/get?foo=bar

请注意,将查询参数传递给 get() 会覆盖 URI 中的所有内容,因此使用其中一个就好。

更多详情见发布公告:

https://laravel-news.com/laravel-7-2-0


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Master Switch

The Master Switch

Tim Wu / Knopf / 2010-11-2 / USD 27.95

In this age of an open Internet, it is easy to forget that every American information industry, beginning with the telephone, has eventually been taken captive by some ruthless monopoly or cartel. Wit......一起来看看 《The Master Switch》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

SHA 加密
SHA 加密

SHA 加密工具