侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

Laravel 11.14版本发布 - 新的字符串助手和ServeCommand改进

Laravel  /  管理员 发布于 11个月前   738

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

  • 上一条:
    Laravel 11.12版本发布 - Artisan的`make`命令自动剪切`.php `扩展
    下一条:
    Laravel 11.15版本发布 - Eloquent Builder中添加的泛型
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • Laravel 11.15版本发布 - Eloquent Builder中添加的泛型(0个评论)
    • Laravel 11.14版本发布 - 新的字符串助手和ServeCommand改进(0个评论)
    • Laravel 11.12版本发布 - Artisan的`make`命令自动剪切`.php `扩展(0个评论)
    • Laravel的轻量型购物车扩展包:binafy/laravel-cart(0个评论)
    • Laravel 11.11版本发布 - 查看模型中的第三方关系:show(0个评论)
    • 近期文章
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • PHP 8.4 Alpha 1现已发布!(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-10
    • 2016-11
    • 2017-07
    • 2017-08
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2020-07
    • 2020-08
    • 2020-09
    • 2020-10
    • 2020-11
    • 2021-01
    • 2021-02
    • 2021-03
    • 2021-04
    • 2021-05
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-11
    • 2021-12
    • 2022-01
    • 2022-02
    • 2022-03
    • 2022-04
    • 2022-05
    • 2022-06
    • 2022-07
    • 2022-08
    • 2022-09
    • 2022-10
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-04
    • 2023-05
    • 2023-06
    • 2023-07
    • 2023-08
    • 2023-09
    • 2023-10
    • 2023-11
    • 2023-12
    • 2024-01
    • 2024-02
    • 2024-03
    • 2024-04
    • 2024-05
    • 2024-06
    • 2024-07
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客