The Laravel team released 8.19 yesterday with job encryption, delaying queue jobs until after a transaction, a schedule:list artisan command, and the latest changes in the 8.x branch:
Delay Queue Jobs During a DB Transaction
Mohamed Said contributed the ability to delay queue jobs until after all database transactions are committed:
DB::transaction(function(){ $user = User::create(...); SendWelcomeEmail::dispatch($user)->afterCommit();});
You can also configure queue connections with the after_commit
boolean to make this behavior the default. In the case of rollbacks, jobs are discarded.
Add has() method to ComponentAttributeBag
Erik C. Forés contributed a new method to determine if a given attribute is present on a component, which returns a boolean
:
@if ($attributes->has('class')) <div>Class Attribute Present</div>@endif
Add schedule:list Command
Andrew Brown contributed a schedule:list
command to list out scheduled task details. This feature is inspired by the ThenPingMe thenpingme:schedule command.
php artisan schedule:list
Introducing Job Encryption
Mohamed Said contributed to the introduction of queue job encryption, providing a UsesEncryption
interface that will encrypt the command inside the payload and decrypt it when running CallQueueHandler
.
Encrypting the command payload hides the job class properties which may hold sensitive information (API keys, passwords, personal information, etc…).
For more details, check out Pull Request #35527.
Release Notes
You can see the full list of new features and updates below and the diff between 8.18.0 and 8.19.0 on GitHub. The following release notes are directly from the changelog:
8.19.0
Added
- Delay pushing jobs to queue until database transactions are committed (#35422, 095d922, fa34d93, db0d0ba, d9b803a, 3e55841)
- Added
Illuminate\View\ComponentAttributeBag::has()
(#35562) - Create ScheduleListCommand (#35574, 97d7834)
- Introducing Job Encryption (#35527, f80f647, 8c16156)