The Laravel team released v13.15.0 with typed translation accessors, JSON Schema deserialization, a dedicated Cloud queue driver, and a couple of security-related validation and routing fixes.
- Typed
trans()->string()和trans()->array()accessors - JSON Schema array deserialization and multi-type union support
- A dedicated Cloud queue driver with managed queue handling
- A fix for a
date_equalsvalidation bypass and tighter route unserialization
什么是新的
Typed Translation Accessors
The translation helpers return broad types:
__()
回报
array|string|null
, 和
trans()
回报
Translator|array|string
. That works in Blade, but it adds friction in strictly-typed code and static analysis. This release adds two typed accessors on the
Translator
to return a concrete type:
民众
功能
标签
()
:
细绳{
返回
反式
()
->
细绳
(
$this
->
姓名);}民众
功能
选项
()
:
大批{
返回
反式
()
->
大批
(
$this
->
options_key);}
The approach mirrors existing typed helpers like
config()
和
request()
。 看
#60443
。
JSON Schema Deserialization
这
JsonSchema
component gained a
fromArray()
deserializer that turns a raw JSON Schema array back into
Type
objects, the inverse of serialization. The release also adds multi-type union support to the schema builder. See
#60387
和
#60455
。
Dedicated Cloud Queue Driver
Several changes land a dedicated queue driver for Laravel Cloud's managed queues. Managed queues are booted before service providers, the queue throws a
ManagedQueueNotFoundException
when a configured queue is missing, and FIFO queue name normalization was corrected. The request ID header was renamed from
X-Request-ID
到
Cloud-Request-ID
and is now output in logs. See
#60181
,
#60199
,
#60276
,
#60189
,
#60166
, 和
#60316
。
Enums in
Queue::route()
You can now pass enum cases to
Queue::route()
for both the queue name and the connection when routing jobs. See
#60402
。
Security:
date_equals
Validation Bypass
这
date_equals
rule used loose comparison. An invalid date string parses to
null
, 和
null == 0
evaluates to true, so an invalid date could pass validation against a reference date that parses to a falsy value (for example
1970-01-01 00:00:00
). The fix uses strict comparison for the equal operator while keeping loose comparison for legitimate
DateTime
objects. See
#60393
。
Security: Restricted Route Unserialization
Routing unserialization now restricts the classes it will accept, reducing the surface for object injection during route caching and resolution. See #60391 。
Number Helper Fixes
A few edge cases in the
Number
helper were corrected:
Number::fileSize()
now handles negative byte values,
Number::trim()
no longer returns
null
为了
INF
和
NAN
, 和
Number::pairs()
now handles negative step values gracefully while throwing an exception for a zero step to prevent infinite loops. See
#60147
,
#60322
, 和
#60324
。
其他修复和改进
- Fixed infinite recursion when a model scope is defined with a private attribute, and when a middleware group references itself ( #59958 , #60002 )
queue:failednow shows the real class name ( #60279 )- 额外
Prohibitable到cache:clear和queue:flush( #60430 ) - 制成
InvokedProcessmacroable ( #60392 ) - Ensured unchanged compiled Blade views are not left expired ( #60401 )
- Added generics to
DatabaseTransactionsManagergetters andQueueRoutes::all()( #60420 , #60447 )
参考






