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

Laravel 10.24版本发布

Laravel  /  管理员 发布于 1年前   302

本周,Laravel 团队发布了 v10.24,其中包括作业伪造更新、字符串位置助手、迁移表名猜测改进等。

虽然我们在每个版本中都会强调新功能,但每周都有许多贡献者在改进框架。

请查看发布说明,了解每周发布的完整变化,感谢所有为 Laravel 做出贡献的人。

下面是本周的新内容概览:


允许伪造旧工作

蒂姆-麦克唐纳(Tim MacDonald)贡献了一个允许旧式队列作业推送的更新:

>目前不支持旧式的队列作业推送,即引用作业类并以数组形式传递有效载荷。

该更新修复了这一问题:

Queue::fake([MyJob::class]);
Queue::push(MyJob::class, ['job' => 'payload']);
Queue::assertPushed(MyJob::class);


引入 Str::substrPos() 方法

Clemens Bastian 提供了一个 substrPos() 方法,用于确定子串在字符串中首次出现的位置。

它是 PHP 的 mb_strpos 方法的封装:

// Str helper
Str::position('Hello, World!', 'W'); // 7
 
// Stringable
str('This is a test string.')->position('test'); // 10
 
// More examples
Str::position('This is a test string, test again.', 'test', 15); // 23
Str::position('Hello, World!', 'Hello'); // 0
Str::position('Hello, World!', 'World!'); // 7
Str::position('This is a tEsT string.', 'tEsT', 0, 'UTF-8'); // 10
Str::position('Hello, World!', 'W', -6); // 7
Str::position('Äpfel, Birnen und Kirschen', 'Kirschen', -10, 'UTF-8'); // 18
Str::position('@%€/=!"][$', '$', 0, 'UTF-8'); // 9
Str::position('Hello, World!', 'w', 0, 'UTF-8'); // false
Str::position('Hello, World!', 'X', 0, 'UTF-8'); // false
Str::position('', 'test'); // false
Str::position('Hello, World!', 'X'); // false


在迁移中正确猜测表名

Islam Abdelfattah 改进了表猜测功能,如果用户在迁移时修改了现有数据库表中的一列,那么猜测功能就会生效。

如果下面的命令以 to_users_table 结尾,该命令将正确创建用户表的迁移:

php artisan make:migration \
    add_is_sent_to_3rd_party_service_column_to_users_table

上述命令生成的迁移将自动在上行/下行方法中包含以下代码:

Schema::table('users', function (Blueprint $table) {
    //
});


版本说明

您可以在 GitHub 上查看以下新功能和更新的完整列表,以及 10.23.0 和 10.24.0 之间的差异。

以下版本说明直接来自更新日志:

https://github.com/laravel/framework/compare/v10.23.0...v10.24.0
https://github.com/laravel/framework/blob/1157523ae2a08449ddfbee737ecdc1479dc3df03/CHANGELOG.md#v10240---2023-09-19


v10.24.0

让查询生成器中连接方法的参数类型保持一致 
@melicerte 发表于 https://github.com/laravel/framework/pull/48386

[10.x] 修复 view:cache 和 artisan up 后的文件竞赛条件
by @roxik in https://github.com/laravel/framework/pull/48368

[10.x] 重新启用 SQL Server CI
作者 @GrahamCampbell 发布于 https://github.com/laravel/framework/pull/48393

更新 request.stub
by @olivsinz in https://github.com/laravel/framework/pull/48402

[10.x] phpdoc: Auth\Access\Response 构造函数允许消息为空
by @snmatsui in https://github.com/laravel/framework/pull/48394

[10.x] 测试改进
@crynobone 发布于 https://github.com/laravel/framework/pull/48390

关闭 csrf_field 的自动完成功能
@maxheckel 发布于 https://github.com/laravel/framework/pull/48371

[10.x] 删除在测试中包含枚举的 PHP 8.1 检查
(由 @Jubeki 发布于 https://github.com/laravel/framework/pull/48415

[10.x] 改进命名方式
(由 @timacdonald 发布于 https://github.com/laravel/framework/pull/48413

[10.x] 修复调用 deleteDirectory 时出现的 "文本文件繁忙 "错误(
由 @ycs77 发布于 https://github.com/laravel/framework/pull/48422

修复小数字键的 Cache::many() 问题
(由 @AlexKarpan 在 https://github.com/laravel/framework/pull/48423 提供

[10.x]将动作/结账从 v3 更新到 v4
作者:@tamiroh 发表于 https://github.com/laravel/framework/pull/48439

lazyById不会检查数据库响应中id(别名)列的可用性,最终会无休止地循环,而chunkById会。

[10.x]允许伪造旧作业
by @timacdonald in https://github.com/laravel/framework/pull/48434

[10.x] 引入 Str::substrPos
by @amacado in https://github.com/laravel/framework/pull/48421

[10.x] 如果列名中包含('to'、'from'和/或'in')项,则在迁移中正确猜测表名
by @i350 in https://github.com/laravel/framework/pull/48437

[10.x] 重构 LazyCollection::take()以节省内存
@fuwasegu 发表于 https://github.com/laravel/framework/pull/48382

[10.x] 当默认值为枚举时获取值属性
(由 @squiaios 在 https://github.com/laravel/framework/pull/48452 提供

[10.x] 编译器助手的改进
@crynobone 发布于 https://github.com/laravel/framework/pull/48448

[10.x] 测试 Symfony v6.4
by @driesvints in https://github.com/laravel/framework/pull/48400


转:

https://laravel-news.com/laravel-10-24-0

  • 上一条:
    go语言多项目批量更新依赖及自动调用jenkins构建流程步骤
    下一条:
    Laravel框架中适用于Eloquent的日期过滤软件包:lara-date-filter
  • 昵称:

    邮箱:

    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中实现一个常用的先进先出的缓存淘汰算法示例代码(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个评论)
    • 近期评论
    • 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交流群

    侯体宗的博客