Laravel v13.10.0 introduces a
storage
cache driver backed by Laravel's filesystem abstraction, making it possible to use an S3 disk (or any configured disk) as a key/value cache store without additional packages. It also adds a
--stop-when-empty-for
queue worker option, a
WorkerIdle
event, schedule group lifecycle callbacks,
Schema::hasForeignKey()
, and several queue testing improvements.
- 新的
storagecache driver backed by Laravel's filesystem --stop-when-empty-forqueue worker optionWorkerIdleevent for idle worker detection- Lifecycle and output callbacks on
Schedule::group() Schema::hasForeignKey()帮手queue:failed --jsonoutput optionassertPushedOnce()testing helper- Enum queue names in
QueueFake WorkerOptionspassed to additional worker events
什么是新的
Storage Cache Store
新的
storage
cache driver uses Laravel's filesystem /
Storage
services to store cached values. This is primarily useful for using an existing S3 disk as a key/value cache — no Redis or Memcached required.
默认
config/cache.php
现在包括
storage
store entry:
'贮存'
=>
[
'司机'
=>
'贮存'
,
'磁盘'
=>
环境
(
'CACHE_STORAGE_DISK'
),
'小路'
=>
环境
(
'CACHE_STORAGE_PATH'
,
'framework/cache/data'
),],
观点
CACHE_STORAGE_DISK
at any configured disk (including
s3
) and the cache driver will read and write values through Laravel's filesystem layer. Each cached value is stored as a file containing a serialized payload with an expiration timestamp.
Queue Worker Idle Stop Option
queue:work
现在接受一个
--stop-when-empty-for
option that stops the worker after it has gone a configured number of seconds without processing any jobs:
php
工匠
队列:工作
--stop-when-empty-for=60
This stops the worker if no jobs have been processed for 60 seconds. It's useful for short-lived workers, scaled-down environments, or any situation where you want workers to exit automatically when queues go quiet rather than running indefinitely.
Worker Idle Event
新的
WorkerIdle
event is dispatched when a queue worker checks for a job and finds the queue empty. This is distinct from
JobPopping
, which fires on every pop attempt regardless of whether a job was found. Listening to
WorkerIdle
lets you detect workers that are genuinely unused — useful for rebalancing worker capacity or logging idle time.
公关稿: #60134 经过 @jackbayliss
Worker Configuration Passed to Additional Worker Events
WorkerOptions
(which includes the
--name
flag and other worker configuration) is now passed to the
Pausing
,
Resuming
,
Interrupted
, 和
Looping
worker events. Previously these events did not include the worker's configuration, making it harder to know which worker instance was involved in a listener.
PR: #60135 , #60153 经过 @jackbayliss
Schedule Group Lifecycle Callbacks
Schedule::group()
now supports the same lifecycle and output callback methods available on individual events. This lets you attach callbacks once for an entire group instead of repeating them on each task:
日程
::
团体
(
功能
(
日程
$schedule) {$时间表
->
命令
(
'reports:generate'
(英文):$时间表
->
命令
(
'reports:email'
(英文):})
->
失败
(
功能
(){
// fires for any failing task in the group})
->
成功时
(
功能
(){
// fires when each task in the group succeeds});
公关稿: #60133 经过 @cosmastech
Scheduled Event Instance in Callbacks
Scheduled event callbacks (such as
onSuccess
,
onFailure
, 和
then
) can now optionally receive the
Event
instance as a parameter. This gives the callback direct access to the event's configuration — its command, output path, and other properties:
$时间表
->
命令
(
'reports:generate'
)
->
失败
(
功能
(
事件
$event) {
日志
::
错误
(
"Scheduled task failed: {
$事件
->
命令
}”
(英文):});
公关稿: #60144 经过 @cosmastech
Schema Foreign Key Existence Helper
新的
Schema::hasForeignKey()
method checks whether a specific foreign key constraint exists on a table, complementing the existing
getForeignKeys()
和
hasIndex()
帮手:
如果
(
!
架构
::
hasForeignKey
(
“命令”
,[
'用户身份'
])){
架构
::
桌子
(
“命令”
,
功能
(
蓝图
$table) {$表
->
外国的
(
'用户身份'
)
->
参考
(
'ID'
)
->
在
(
“用户”
(英文):});}
This is useful in migrations, package install scripts, and schema assertions where you want to avoid adding a foreign key that already exists.
公关稿: #60169 经过 @Tresor-Kasenda
JSON Output for Failed Jobs
这
queue:failed
Artisan command now accepts a
--json
flag, outputting failed jobs as JSON. Each entry includes
id
,
connection
,
queue
,
class
, 和
failed_at
. An empty result returns
[]
. This matches the
--json
support already available on
route:list
,
db:show
,
queue:monitor
, and other commands.
公关稿: #60168 经过 @Tresor-Kasenda
SQS Overflow Flush on Queue Clear
The SQS extended store (added in 13.9.0) now supports a
flush_on_clear
option. When enabled, running
queue:clear
will also call
flush()
on the configured overflow cache store after purging SQS, reclaiming storage immediately rather than waiting for TTL expiration. This matters for S3-backed stores where leftover objects incur ongoing cost:
'平方'
=>
[
// ...
'extended_store_options'
=>
[
‘已启用’
=>
真的
,
'磁盘'
=>
's3'
,
'flush_on_clear'
=>
真的
,],],
This option defaults to
false
to preserve existing behavior. Note that for most cache stores,
flush()
wipes the entire store — point
overflow.store
at a dedicated cache store (the new
storage
driver is a natural fit here) to avoid unintended data loss.
Assert Job Pushed Once
Queue::assertPushedOnce()
is a more readable alternative to
Queue::assertPushedTimes(JobClass::class, 1)
:
// 前队列
::
assertPushedTimes
(
ProcessOrderJob
::班级
,
1
(英文):// 后队列
::
assertPushedOnce
(
ProcessOrderJob
::班级
(英文):
公关稿: #60150 经过 @weshooper
Enum Queue Names in Fake Queue Assertions
QueueFake
now normalizes enum queue names the same way the real queue driver does. Passing a
UnitEnum
case as a queue name to
push()
,
size()
, 或者
pendingJobs()
now works correctly, and assertions against enum queue names behave consistently with their string equivalents.
公关稿: #60161 经过 @Tresor-Kasenda
Cloud Request ID in Logs
For applications running on Laravel Cloud, the request ID is now output in log entries using a custom JSON formatter. It appears as a standalone field rather than being nested inside the Monolog
context
或者
extra
块。
公关稿: #60156 经过 @jradtilbrook
其他修复和改进
- 使固定
starts_with/ends_withrejecting numeric values — these validation rules now correctly handle numeric input by casting to string before comparison, restoring behavior from Laravel 12 ( #60120 经过 @aydinfatih ) - URL encode paths for signed URLs
— storage paths are now URL-encoded before being placed into signed route path segments, fixing temporary signed URLs that contain
?,&, 或者#characters ( #60137 经过 @泰勒韦尔 ) - Delimit aggregate alias — SQL aggregate function aliases are now delimited to prevent conflicts with reserved words ( #60140 经过 @willrowe )
- Optimize Worker queue pause check — the queue worker's pause check is now more efficient ( #60109 经过 @jackbayliss )
- Validate against line breaks in emails — email validation now rejects values containing line breaks ( #60151 经过 @泰勒韦尔 )
参考






