Thursday, September 14, 2023
HomePHPLaravel 10.22 Launched|Laravel Information

Laravel 10.22 Launched|Laravel Information


Today, the Laravel group launched v10.21.1 and also v10.22 with ULID screening assistants, precognition screening assistants, Enum assistance in Policy:: in() and also Policy:: notIn() recognition regulations, and also extra:

ULID screening assistants

Jason Jones added screening assistants for the generation of ULIDs to match screening assistants produced for UUIDs:

$ ulid = Str:: ulid();

Str:: createUlidsUsing( fn() => > $ulid);

Str:: ulid() == = $ulid; // real

// Freeze ULID generation after that bring back generation

$ ulid = Str:: freezeUlids();

Str:: ulid() == = Str:: ulid() == = $ulid; // real

Str:: createUlidsNormally();

// Freeze throughout of the closure

Str:: freezeUlids( feature ($ ulid) {

Str:: ulid() == = Str:: ulid() == = $ulid; // real

} );

Str:: ulid() == = Str:: ulid(); // incorrect

// Series of ULIDs

Str:: createUlidsUsingSequence([

$zeroth = Str::ulid(),

$first = Str::ulid(),

]);

Str:: ulid() == = $zeroth;

Str:: ulid() == = $very first;

Str:: ulid(); // back to generally created ULIDs.

I really did not provide the whole API readily available; you can look into Pull Demand # 48276 for even more information.

Precognition screening assistants

Peter Fox added screening assistants for Laravel Precognition

$ this->> withPrecognition()

->> obtain('/')

->> assertSuccessfulPrecognition();

Enum assistance for in and also notIn recognition regulations

Tim Geisendoerfer added enum assistance for the Policy:: in() and also Policy:: notIn() recognition regulations:

enum Shade: string

{

instance RED = ' red';

instance ECO-FRIENDLY = ' environment-friendly';

instance BLUE = ' blue';

}

// Make use of the Shade enum with Policy:: in()

Validator:: verify(

['color'=>'green'],

[

'color'=> [

Rule::in([Color::RED, Color::GREEN])

]

],

);

Launch notes

You can see the total listing of brand-new functions and also updates listed below and also the diff in between 10.21.0 and also 10.22.0 on GitHub. The adhering to launch notes are straight from the changelog:

  • [10.x] Include ulid screening assistants by @Jasonej in https://github.com/laravel/framework/pull/48276
  • [10.x] Repair concern with table prefix replication in DatabaseTruncation attribute by @mobidev86 in https://github.com/laravel/framework/pull/48291
  • [10.x] Took care of a typo in phpdoc block by @back2Lobby in https://github.com/laravel/framework/pull/48296
  • [10.x] HotFix: toss caught UniqueConstraintViolationException if there are no matching documents on SELECT retry by @mpyw in https://github.com/laravel/framework/pull/48234
  • [10.x] Includes screening assistants for Precognition by @peterfox in https://github.com/laravel/framework/pull/48151
  • [10.x] GeneratorCommand – Arranging feasible designs and also occasions by @TWithers in https://github.com/laravel/framework/pull/48249
  • [10.x] Include Enum Assistance to the In and also NotIn Recognition Guidelines by @geisi in https://github.com/laravel/framework/pull/48247
  • PHP 8.3 Assistance by @driesvints in https://github.com/laravel/framework/pull/48265
  • [10.x] Phone Call renderForAssertions in all Mailable assertions by @jamsch in https://github.com/laravel/framework/pull/48254
  • [10.x] Introduce requireEnv assistant by @lucasmichot in https://github.com/laravel/framework/pull/48261
  • [10.x] Incorporate prefix with table for compileDropPrimary PostgreSQL by @dyriavin in https://github.com/laravel/framework/pull/48268
  • [10.x] BelongsToMany Docblock Improvements by @crynobone in https://github.com/laravel/framework/pull/48282
RELATED ARTICLES

Most Popular

Recent Comments