The Laravel team released v12.11.0, which includes typed Arr
getter methods, job payload additions, the FakeJob
class now implements the Job
contract, and more:
Typed Getters for Arr Helpers
Anthony Tibbs contributed typed getter helpers for the Arr
support class for array
, boolean
, float
, integer
, and string
. Each method will attempt to return the type and throw an exception if the data doesn't match types:
use Illuminate\Support\Arr;$array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']]; $value = Arr::array($array, 'languages'); // ['PHP', 'Ruby']$value = Arr::array($array, 'name'); // throws InvalidArgumentException
See Pull Request #55567 for details.
CreatedAt and Original Delay Added to Job Payload
Taylor Otwell contributed adding the payload creation and job delay info to job payloads. The delay is the optional job delay in seconds and the createdAt
is the timestamp of when the job payload is created:
$job->payload();/*Now includes: ['delay' => 5, 'createdAt' => 1745965273]*/
See Pull Request #55529 for details.
Ensure Fake Job Implements the Job Contract
Tim MacDonald added the Illuminate\Contracts\Queue\Job
contract to the FakeJob
class used in tests to fake queue jobs:
The fake job is used in places where an implementation of the job contract is expected.
This ensures that the fake job supports strict typing of the job contract when, for example, listening for events and passing the job instance around.
See Pull Request #55574 for details.
Release notes
You can see the complete list of new features and updates below and the diff between 12.10.0 and 12.11.0 on GitHub. The following release notes are directly from the changelog:
v12.11.0
- Add payload creation and original delay info to job payload by @taylorotwell in https://github.com/laravel/framework/pull/55529
- Add config option to ignore view cache timestamps by @pizkaz in https://github.com/laravel/framework/pull/55536
- [12.x] Dispatch NotificationFailed when sending fails by @rodrigopedra in https://github.com/laravel/framework/pull/55507
- [12.x] Option to disable dispatchAfterResponse in a test by @gdebrauwer in https://github.com/laravel/framework/pull/55456
- [12.x] Pass flags to custom Json::$encoder by @rodrigopedra in https://github.com/laravel/framework/pull/55548
- [12.x] Use pendingAttributes of relationships when creating relationship models via model factories by @gdebrauwer in https://github.com/laravel/framework/pull/55558
- [12.x] Fix double query in model relation serialization by @AndrewMast in https://github.com/laravel/framework/pull/55547
- [12.x] Improve circular relation check in Automatic Relation Loading by @litvinchuk in https://github.com/laravel/framework/pull/55542
- [12.x] Prevent relation autoload context from being serialized by @litvinchuk in https://github.com/laravel/framework/pull/55582
- Remove
@internal
Annotation from$components
Property inInteractsWithIO
by @michaelnabil230 in https://github.com/laravel/framework/pull/55580 - Ensure fake job implements job contract by @timacdonald in https://github.com/laravel/framework/pull/55574
- [12.x] Fix
AnyOf
constructor parameter type by @axlon in https://github.com/laravel/framework/pull/55577 - Sync changes to Illuminate components before release by @driesvints in https://github.com/laravel/framework/pull/55591
- [12.x] Set class-string generics on
Enum
rule by @cosmastech in https://github.com/laravel/framework/pull/55588 - [12.x] added detailed doc types to bindings related methods by @taka-oyama in https://github.com/laravel/framework/pull/55576
- [12.x] Improve @use directive to support function and const modifiers by @rodolfosrg in https://github.com/laravel/framework/pull/55583
- 12.x scheduled task failed not dispatched on scheduled task failing by @achrafAa in https://github.com/laravel/framework/pull/55572
- [12.x] Introduce Reflector methods for accessing class attributes by @daniser in https://github.com/laravel/framework/pull/55568
- [12.x] Typed getters for Arr helper by @tibbsa in https://github.com/laravel/framework/pull/55567