Laravel 10.42版本发布 - HTTP 客户端的全局默认值、密码的最大验证规则等
Laravel  /  管理员 发布于 1年前   325
本周,Laravel 团队发布了 v10.42,其中包括 HTTP 客户端的全局默认选项、
密码规则对象的最大验证规则、字符串解包助手等。
HTTP 客户端的全局默认选项
Tim MacDonald 提供了通过服务提供商为 HTTP 客户端配置全局默认选项的功能:
Http::globalOptions([
'timeout' => 5,
'connect_timeout' => 2,
]);
如果多次调用 globalOptions 方法,则在后续调用中将覆盖原来的全局配置。
字符串解包助手
Steve Bauman 提供了一个 Str::unwrap() 方法,您可以用它来解开字符串:
// Unquote
Str::unwrap('"Unquote"', '"');
// `Unquote`
// some: "json"
Str::unwrap('{ some: "json" }', '{', '}');
// ` some: "json" `
一次添加多个通道/路由
D. Nagy Gergő 提供了为按需通知一次配置多个路由的功能:
NotificationFacade::routes([
'mail' => ['[email protected]' => 'Test Customer'],
'vonage' => '+3620123456',
])->notify(new OrderStatusChanged($order));
新的作业队列事件
Daniel Mason 为框架贡献了一个 JobQueueing 事件,该事件会在作业发送到队列提供者之前触发。
下面是该事件实例化的一个粗略示例,
其中包括 $connectionName、$job 和 $payload:
use Illuminate\Queue\Events\JobQueueing;
new JobQueueing($this->connectionName, $job, $payload));
密码的最大验证规则
Jeremy Angele 为密码规则对象提供了最大长度验证规则。
这在定义默认密码规则时非常有用:
// Before
Password::min(8)->rules('max:32');
// New max() method
Password::min(8)->max(32);
发布说明
您可以在 GitHub 上查看以下新功能和更新的完整列表,以及 10.41.0 和 10.42.0 之间的差异。
以下版本说明直接来自更新日志:
https://github.com/laravel/framework/compare/v10.41.0...v10.42.0
https://github.com/laravel/framework/blob/882fed2167262881aae16c45e4fce22f9cd5b0b6/CHANGELOG.md#v10420---2024-01-23
v10.42.0
[10.x] 在 File::hasSameHash() 中改用 hash_equals
by @simonhamp in https://github.com/laravel/framework/pull/49721
[10.x] 修复可调用 $condition 的 Rule::unless
by @dbakan in https://github.com/laravel/framework/pull/49726
[10.x] 添加 JobQueueing 事件
by @dmason30 in https://github.com/laravel/framework/pull/49722
[10.x] 修复 MailLogTransport 中的解码问题
by @rojtjo in https://github.com/laravel/framework/pull/49727
[10.x] 实施密码 "最大值 "验证规则,
作者 @angelej,原文地址:https://github.com/laravel/framework/pull/49739
[10.x] 同时向 AnonymousNotifiable 添加多个通道/路径
(由 @iamgergo 在 https://github.com/laravel/framework/pull/49745 提供
[10.x] 按字母顺序对服务提供商进行排序,
作者:@buismaarten,原文地址:https://github.com/laravel/framework/pull/49762
[10.x] http 工厂的全局默认选项
(由 @timacdonald 在 https://github.com/laravel/framework/pull/49767 提供
[10.x] 仅在从 Laravel 访问或同时使用 illuminate/support 时使用 Carbon
by @crynobone in https://github.com/laravel/framework/pull/49772
[10.x] 添加 Str::unwrap
by @stevebauman in https://github.com/laravel/framework/pull/49779
[10.x] 允许在 Carbon::createFromId() 中使用 Uuid 和 Ulid
by @kylekatarnls in https://github.com/laravel/framework/pull/49783
[10.x] 测试改进
@crynobone 发布于 https://github.com/laravel/framework/pull/49785
转:
https://laravel-news.com/laravel-10-42-0
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号