Laravel 10.22 Released


September 6th, 2023

Laravel 10.22 Released

This week, the Laravel team released v10.21.1 and v10.22 with ULID testing helpers, precognition testing helpers, Enum support in Rule::in() and Rule::notIn() validation rules, and more:

ULID testing helpers

Jason Jones contributed testing helpers for the generation of ULIDs to match testing helpers created for UUIDs:

$ulid = Str::ulid();
Str::createUlidsUsing(fn() => $ulid);
Str::ulid() === $ulid; // true
// Freeze ULID generation then restore generation
$ulid = Str::freezeUlids();
Str::ulid() === Str::ulid() === $ulid; // true
// Freeze for the duration of the closure
Str::freezeUlids(function ($ulid) {
Str::ulid() === Str::ulid() === $ulid; // true
Str::ulid() === Str::ulid(); // false
// Sequences of ULIDs
$zeroth = Str::ulid(),
$first = Str::ulid(),
Str::ulid() === $zeroth;
Str::ulid() === $first;
Str::ulid(); // back to normally generated ULIDs.

I didn't list the entire API available; you can check out Pull Request #48276 for more details.

Precognition testing helpers

Peter Fox contributed testing helpers for Laravel Precognition


Enum support for in and notIn validation rules

Tim Geisendoerfer contributed enum support for the Rule::in() and Rule::notIn() validation rules:

enum Color: string
case RED = 'red';
case GREEN = 'green';
case BLUE = 'blue';
// Use the Color enum with Rule::in()
'color'=> [
Rule::in([Color::RED, Color::GREEN])

Release notes

You can see the complete list of new features and updates below and the diff between 10.21.0 and 10.22.0 on GitHub. The following release notes are directly from the changelog:

v10.22.0 - 2023-09-05

  • [10.x] Add ulid testing helpers by @Jasonej in
  • [10.x] Fix issue with table prefix duplication in DatabaseTruncation trait by @mobidev86 in
  • [10.x] Fixed a typo in phpdoc block by @back2Lobby in

v10.21.1 - 2023-09-04

  • [10.x] HotFix: throw captured UniqueConstraintViolationException if there are no matching records on SELECT retry by @mpyw in
  • [10.x] Adds testing helpers for Precognition by @peterfox in
  • [10.x] GeneratorCommand - Sorting possible models and events by @TWithers in
  • [10.x] Add Enum Support to the In and NotIn Validation Rules by @geisi in
  • PHP 8.3 Support by @driesvints in
  • [10.x] Call renderForAssertions in all Mailable assertions by @jamsch in
  • [10.x] Introduce requireEnv helper by @lucasmichot in
  • [10.x] Combine prefix with table for compileDropPrimary PostgreSQL by @dyriavin in
  • [10.x] BelongsToMany Docblock Improvements by @crynobone in

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.