Laravel 11.14版本发布 - 新的字符串助手和ServeCommand改进
Laravel  /  管理员 发布于 8个月前   541
Laravel团队上周中期发布了v11.13,本周发布了v111.4。
这些版本增加了新的字符串方法,如chopStart和chopEnd,
支持Laravel的string markdown方法的Commonmark扩展,Number::pairs()方法等等。
弦乐chopStart和chopEnd(v11.13)
Tim MacDonald贡献了两种字符串方法,用于从字符串的开头或结尾截断字符。
chopStart和chopEnd方法可以使用Str o Stringable`类获得:
Str::chopEnd('path/to/file.php', '.php');
// "path/to/file"
Str::chopStart('https://laravel.com', ['https://', 'http://']);
// laravel.com
为Str::markdown()和Stringable类添加对扩展的支持
Tony Lea支持将Commonmark扩展作为第三个参数传递给Str::markdown()方法:
$html = Str::markdown($markdown_contents, [], [
new AttributesExtension(),
new TaskListExtension(),
]);
在Laravel 11.14中,Luke Downing延续了Tony Lea的贡献,
在Stringable类中添加了对Commonmark扩展的支持:
$html = str('# My Heading')->markdown(
extensions: [new HeadingPermalinksExtension()]
);
Macroable TokenGuard(v11.13)
@Iman在TokenGuard类中添加了Macroable特性,以支持此保护上的自定义宏。
有关详细信息,请参阅Pull Request#51922。
添加编号::pairs()(v11.13)
Adam Campbell贡献了Number::pairs()方法,
该方法“提供了将数字‘拆分’为最小/最大值对的能力。
这有点像滑动,只是该方法将为您确定值。”:
$output = Number::pairs(25, 10);
// [[1, 10], [11, 20], [21, 25]]
$output = Number::pairs(25, 10, 0);
// [[0, 10], [10, 20], [20, 25]]
$output = Number::pairs(10, 2.5, 0)
// [[0, 2.5], [2.5, 5.0], [5.0, 7.5], [7.5, 10.0]]
使用PHP的SensitiveParameter属性标记敏感参数(v11.14)
Philip Iezzi对Laravel进行了更新,试图用PHP>=8.2的SensitiveParameter属性标记敏感参数。
这是一个很好的提醒,如果您运行PHP>=8.2,请在应用程序代码中利用此属性。
有关详细信息,请参阅Pull Request#51940。
改进工匠服务指挥
Seth Phat对工匠发球命令做出了改进:
打印出一个更好的请求时间,对于需要不到1秒的请求,~0s似乎根本没有帮助。
显示请求的路线,而不是“………”
耗时不到1秒的请求现在以毫秒而不是0打印时间:
发布说明
Laravel 11.13于上周中期发布,因此以下发布说明来自这两个版本。
您可以在GitHub上看到下面新功能和更新的完整列表,以及11.12.0和11.14.0之间的差异。
以下发行说明直接来自变更日志:
https://github.com/laravel/framework/compare/v11.12.0...v11.14.0
https://github.com/laravel/framework/blob/b397704f8a5bae532bd03fa4acf8aa08cd40c4e7/CHANGELOG.md#v11140---2024-07-02
v11.14.0
在@barttenhoed的publish命令中添加害虫存根https://github.com/laravel/framework/pull/51933
[11.x]在@JamesFreeman的FakeJob中添加了attempts()方法https://github.com/laravel/framework/pull/51951
[11.x]通过@Jubeki在Ubuntu 24.04上运行所有工作流https://github.com/laravel/framework/pull/51946
[11.x]改进Arr类中mapSpread方法的PHPDoc,并通过@lmottasin从IDE中删除警告https://github.com/laravel/framework/pull/51952
从3.0.2到3.0.3的凹凸大括号位于/src/Lilluminate/Foundation/resources/exceptions/renderer中,由@religiot在https://github.com/laravel/framework/pull/51955
[11.x]通过@seriquynh删除AssertableJsonString中无法访问的代码https://github.com/laravel/framework/pull/51943
[11.x]通过@seriquynh修复TestResponseAssert文档块https://github.com/laravel/framework/pull/51942
[11.x]壮举:通过@calebdw在https://github.com/laravel/framework/pull/51938
[11.x]在中用@online标记具有SensitiveParameter属性的敏感参数https://github.com/laravel/framework/pull/51940
[11.x]为Stringable类添加了对Markdown扩展的支持。通过@lukeraymonddowning inhttps://github.com/laravel/framework/pull/51932
[11.x]通过@seriquynh在Components\Factory类中添加秘密方法声明https://github.com/laravel/framework/pull/51949
[11.x]通过@Jubeki在Windows 2022上运行工作流,并使用bash而不是powershellhttps://github.com/laravel/framework/pull/51958
[11.x]通过@chu121su12修复重复的返回类型PHPDochttps://github.com/laravel/framework/pull/51965
[11.x]修复中@nshiro的测试失败消息https://github.com/laravel/framework/pull/51974
[11.x]更新测试以确保邮件消息在中通过@seriquynh实现流畅的接口模式https://github.com/laravel/framework/pull/51969
[11.x]通过@hafezdivandari在HttpResponseException上设置上一个异常https://github.com/laravel/framework/pull/51968
[11.x]修复@zbundy在SupportCollectionTest中的拼写错误https://github.com/laravel/framework/pull/51966
[11.x]@sethsandaru对ServeCommand的改进(添加更多爱并提升DX)https://github.com/laravel/framework/pull/51957
[11.x]添加了对@haniha在MariaDb连接中使用castAsJson的支持https://github.com/laravel/framework/pull/51963
[11.x]通过@innocenzi在中添加对通过容器对属性进行操作的支持https://github.com/laravel/framework/pull/51934
[11.x]修复组件:resolveComponents使用@seriquynh的测试https://github.com/laravel/framework/pull/51988
[11.x]通过@seriquynh更新composer.json文件以提供PSR实现https://github.com/laravel/framework/pull/51983
[11.x]在中为@hpaia的软删除事件添加排队闭包类型https://github.com/laravel/framework/pull/51982
[11.x]修复了@guiqibusixin在不同上下文中使用容器嵌套制作相同“抽象”的问题https://github.com/laravel/framework/pull/51989
[11.x]修复了@Tofandel在https://github.com/laravel/framework/pull/51984
v11.13.0
[11.x]通过@tnylea在Str::markdown方法中添加对扩展的支持https://github.com/laravel/framework/pull/51907
[11.x]更新配置:通过@seriquynh在中显示命令https://github.com/laravel/framework/pull/51902
[11.x]通过@seriquynh修复控制台提示docblockhttps://github.com/laravel/framework/pull/51913
[11.x]修复了@seriquynh在https://github.com/laravel/framework/pull/51916
[11.x]在中用@timacdonald将$queue标记为可空https://github.com/laravel/framework/pull/51912
@imanghafoori1在TokenGuard上使用Macroable traithttps://github.com/laravel/framework/pull/51922
[11.x]通过@seriquynh更新命令::fail()停靠块和测试https://github.com/laravel/framework/pull/51914
还原并添加@jasonmccreary的测试https://github.com/laravel/framework/pull/51924
[11.x]在中显示@nshiro的视图创建消息https://github.com/laravel/framework/pull/51925
[11.x]介绍Str::chopStart和Str::chapEnd作者@timacdonaldhttps://github.com/laravel/framework/pull/51910
feat:添加数字::成对@hotmeteor inhttps://github.com/laravel/framework/pull/51904
[11.x]通过@crynobone在中修复了通过进程给定命令作为数组的转义路径https://github.com/laravel/framework/pull/51926
[11.x]通过@princejohnsantillan在中自定义MultipleInstanceManager驱动程序字段https://github.com/laravel/framework/pull/51905
[11.x]在新的Laravel错误页面上由@shengslogar解释长字符串https://github.com/laravel/framework/pull/51880
转:
https://laravel-news.com/laravel-11-14-0
123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号