The Laravel team released v13.31.0 with a queue connection
totalSize()
method, a new
JobInterrupted
event, chaperone support for
BelongsToMany
pivot models, and more.
Queue Total Size
杰克·贝利斯
贡献了
totalSize()
method, which answers the question "how many total jobs do I have on my queue connection right now?"
// 前队列
::
totalPendingSize
()
+
队列
::
totalDelayedSize
()
+
队列
::
totalReservedSize
();// 后队列
::
totalSize
();
看 #61373 更多细节。
Job Interrupted Event
杰克·贝利斯
贡献了新的
JobInterrupted
event that is fired when a job holding the
Interruptible
contract is interrupted by the worker. This allows you to listen for this event and perform any necessary cleanup or logging.
使用
Illuminate\Queue\Events\JobInterrupted
;事件
::
听
(
JobInterrupted
::班级
,
功能
(
JobInterrupted
$event) {
// Handle the job interruption});
看 #61412 更多细节。
Chaperone Support for BelongsToMany Pivot Models
迦勒·怀特
contributed chaperone support for
BelongsToMany
pivot models. This allows you to use the
chaperone()
方法
BelongsToMany
relationship to retrieve the pivot model instance.
Many times when using custom pivot models, the BelongsTo relations can be defined on the model---however, trying to use them requires loading the models from the database even though both of the models are available during the BelongsToMany hydration.
...This PR adds chaperone support to the BelongsToMany relation, if a custom pivot model is not provided then calling
->chaperone()is a no-op.
班级
PostTagPivot
延伸
枢{
民众
功能
邮政
()
:
属于{
返回
$this
->
属于
(
邮政
::班级
(英文):}
民众
功能
标签
()
:
属于{
返回
$this
->
属于
(
标签
::班级
(英文):}}班级
标签
延伸
模型{
民众
功能
帖子
()
:
属于多个{
返回
$this
->
属于多
(
邮政
::班级
)
->
使用
(
PostTagPivot
::班级
)
// automatically guesses relationship names
->
伴侣
();
// but can override if needed or non-standard
->
伴侣
(
declaring
:
'tag'
,
有关的
:
'邮政'
(英文):}}班级
邮政
延伸
模型{
民众
功能
标签
()
:
属于多个{
返回
$this
->
属于多
(
标签
::班级
)
->
使用
(
PostTagPivot
::班级
)
->
伴侣
(
declaring
:
'邮政'
,
有关的
:
'tag'
(英文):}}
看 #61152 更多细节。
Vite Dev Server URL
@ramonmalcolm10
贡献了一个
devServerUrl()
method to the Vite class, which allows you to retrieve the URL of the Vite development server. This is useful for generating asset URLs in your application.
看 #61465 更多细节。
Once Assertions for Mail and Notification Fakes
@talaridisTh contributed new "once" assertions for the Mail and Notification fakes:
// 前邮件
::
assertSentTimes
(
订单已发货
::班级
,
1
(英文):邮件
::
assertQueuedTimes
(
订单已发货
::班级
,
1
(英文):通知
::
assertSentToTimes
($user,
InvoicePaid
::班级
,
1
(英文):通知
::
assertSentOnDemandTimes
(
InvoicePaid
::班级
,
1
(英文):// 后邮件
::
assertSentOnce
(
订单已发货
::班级
(英文):邮件
::
assertQueuedOnce
(
订单已发货
::班级
(英文):通知
::
assertSentToOnce
($user,
InvoicePaid
::班级
(英文):通知
::
assertSentOnDemandOnce
(
InvoicePaid
::班级
(英文):
看 #61415 更多细节。
发行说明
您可以在下面查看新功能和更新的完整列表以及之间的差异 13.30.0 and 13.31.0 在 GitHub 上。以下发行说明直接来自 变更日志 :
v13.31.0
- [12.x] Ensure password hash matches stored cookie before authenticating the user by @crynobone 在 https://github.com/laravel/framework/pull/61386
- [12.x] Fix TypeError in userFromRecaller() when the recaller matches no user by @lazerg 在 https://github.com/laravel/framework/pull/61397
- [13.x] Add totalSize method to Queue by @jackbayliss 在 https://github.com/laravel/framework/pull/61373
- Merge branch '12.x' into 13.x by @crynobone 在 https://github.com/laravel/framework/pull/61399
- [13.x] Restore the container instance after route:cache boots a fresh application by @lazerg 在 https://github.com/laravel/framework/pull/61405
- [13.x] Include connection and queue on WorkerStopping when worker is killed by @jackbayliss 在 https://github.com/laravel/framework/pull/61408
- [13.x] Fix lazy() and lazyById() ignoring limit() and offset() by @khurshudyan 在 https://github.com/laravel/framework/pull/61402
- [13.x]
JobInterrupted事件 @jackbayliss 在 https://github.com/laravel/framework/pull/61412 - [13.x] Make the Redis queue driver cluster-safe (
bulk()node-lessMULTI;allQueueNames()用途KEYS) 经过 @Orrison 在 https://github.com/laravel/framework/pull/61198 - [13.x] feat: add chaperone support for BelongsToMany pivot models by @calebdw 在 https://github.com/laravel/framework/pull/61152
- Dedupe common test fixtures by @jasonmccreary 在 https://github.com/laravel/framework/pull/61422
- [13.x] feat: improve higher order proxy generic types by @calebdw 在 https://github.com/laravel/framework/pull/61418
- Apply fixes from StyleCI by @泰勒韦尔 在 https://github.com/laravel/framework/pull/61427
- [13.x] Add
onceassertions to the mail and notification fakes by @talaridisTh 在 https://github.com/laravel/framework/pull/61415 - Let Monolog handle deprecation exceptions by @sysdev34-wq 在 https://github.com/laravel/framework/pull/61414
- [13.x] Default
memoryExceededExitCodefor Cloud by @jackbayliss 在 https://github.com/laravel/framework/pull/61430 - [13.x] Fix context not being propagated to concurrent processes by @newtonjob 在 https://github.com/laravel/framework/pull/61419
- [13.x] Remove the unused Request import from the JSON:API resource stub by @Bosun18 在 https://github.com/laravel/framework/pull/61434
- [13.x] Memory leak fix in Http Client by @skr4dan 在 https://github.com/laravel/framework/pull/61438
- [13.x] Fix SelfBuilding build stack cleanup after exceptions by @emrebalasar 在 https://github.com/laravel/framework/pull/61454
- [13.x] defer all logic to the dedicated rule by @browner12 在 https://github.com/laravel/framework/pull/61445
- Wrap the closure return type in
withFreshQueryLog()经过 @SanderMuller 在 https://github.com/laravel/framework/pull/61444 - [13.x] Fix
assertJsonMissingPath()ignoring wildcards by @khurshudyan 在 https://github.com/laravel/framework/pull/61441 - [13.x] Resolve the
UsePolicyattribute from parent classes by @khurshudyan 在 https://github.com/laravel/framework/pull/61439 - [13.x] Resolve the
UseEloquentBuilderattribute from parent classes by @khurshudyan 在 https://github.com/laravel/framework/pull/61440 - [13.x] Fix parameter docblocks that contradict the native signature by @dfinchenko 在 https://github.com/laravel/framework/pull/61457
- Bump softprops/action-gh-release from 3.0.2 to 3.0.3 in the github-actions group by @dependabot [机器人] 在 https://github.com/laravel/framework/pull/61468
- [13.x] Fix RateLimited job middleware hitting limits that did not block the job by @khurshudyan 在 https://github.com/laravel/framework/pull/61449
- [13.x] Add
devServerUrl()to Vite by @ramonmalcolm10 在 https://github.com/laravel/framework/pull/61465 - [13.x] Retry phpredis commands when a connection reset surfaces as a warning by @Orrison 在 https://github.com/laravel/framework/pull/61462
- [13.x] Fix callbacks deferred from within a deferred callback by @newtonjob 在 https://github.com/laravel/framework/pull/61431
- [13.x] Propagate command_retries to phpredis cluster connections by @Orrison 在 https://github.com/laravel/framework/pull/61460
- [13.x] Qualify soft delete column with the query's table alias by @arunarw 在 https://github.com/laravel/framework/pull/61456
- [13.x] Keep Eloquent on the direct connection during migrations by @danielebarbaro 在 https://github.com/laravel/framework/pull/61435
- Apply fixes from StyleCI by @泰勒韦尔 在 https://github.com/laravel/framework/pull/61470
- [13.x] Fix Class
Illuminate\Session\ArraySessionHandlerimplementingSessionHandlerInterfaceis missing thecreate_sid()method which will be required in PHP 9.0 by @crynobone 在 https://github.com/laravel/framework/pull/61469 - Fix route url generation under certain circumstances by @泰勒韦尔 在 https://github.com/laravel/framework/pull/61475
- [13.x] Fix message ID and header persistence on ResendTransport by @saurabhsharma2u 在 https://github.com/laravel/framework/pull/61476
- [13.x] Fix wherePivot() closure scope being ignored in pivot table operations by @iz-ahmad 在 https://github.com/laravel/framework/pull/61488







