Thursday, March 23, 2023
HomePHPLaravel 9.37 Launched | Laravel Information

Laravel 9.37 Launched | Laravel Information


The Laravel staff launched 9.37 this week together with a number of patch releases between 9.37 and the discharge of Laravel 9.36. This week’s releases added help for preloading belongings with Vite, new strict violation handlers, verbose view caching CLI output, and extra.

Verbose view caching

Andrew Brown contributed the power to go -v to the view:cache artisan command to output the directories the command is wanting in and -vv to see each file the command caches.

1php artisan view:cache -vv

Here is an instance of what you may see with a contemporary set up of Laravel 9.37:

view:cache verbose output

Handlers for silently discarded and lacking attributes

Aaron Francis contributed the power to register handlers for “silently discarded” and “lacking attributes” strict mode violations:

1Mannequin::handleMissingAttributeViolationUsing(

2 operate ($mannequin, $key) {

3 // ...

4 }

5);

6 

7Mannequin::handleDiscardedAttributeViolationUsing(

8 operate ($mannequin, $keys) {

9 // ...

10 }

11);

Move a closure for the rescue report param

@foremtehan contributed passing a callable because the $report parameter when utilizing rescue() so you possibly can conditionally report the error primarily based on the boolean returned:

1rescue(fn() => 'error', fn() => 'rescue', operate(Throwable $e){

2 return $e instanceof SomeException;

3});

Help preloading belongings with Vite

Tim MacDonald contributed preloading of belongings required for the present web page load with Vite. It’s now the default habits for Laravel functions utilizing Vite. The small print of how this works is kind of intricate, and I might advocate studying the outline of Pull Request #44096. Additionally, you possibly can be taught extra concerning the common ideas behind preloading crucial belongings to enhance loading pace.

Question builder uncooked worth technique

@eusonlito contributed a rawValue() technique to get a worth from a SQL expression. Listed here are some examples from the pull request:

1$first = TripModel::orderBy('date_at', 'ASC')

2 ->rawValue('YEAR(`date_at`)');

3$final = TripModel::orderBy('date_at', 'DESC')

4 ->rawValue('YEAR(`date_at`)');

5 

6$fullname = UserModel::the place('id', $id)

7 ->rawValue('CONCAT(`first_name`, " ", `last_name`)');

Launch Notes

You may see the entire checklist of recent options and updates under and the diff between 9.36.0 and 9.37.0 on GitHub. The next launch notes are straight from the changelog:

v9.37.0

Added

  • Added elective verbose output when view caching (#44673)
  • Enable passing closure to rescue $report parameter (#44710)
  • Help preloading belongings with Vite (#44096)
  • Added Illuminate/Mail/Mailables/Content material::htmlString() (#44703)

Fastened

  • Fastened mannequin:present registering getAttribute() as a null accessor (#44683)
  • Repair expectations for output assertions in PendingCommand (#44723)

v9.36.4

Added

  • Added rawValue to Database Question Builder (and Eloquent as wrapper) (#44631)
  • Added TransactionCommitting (#44608)
  • Added dontIncludeSource to CliDumper and HtmlDumper (#44623)
  • Added Illuminate/Filesystem/FilesystemAdapter::checksum() (#44660)
  • Added handlers for silently discarded and lacking attribute violations (#44664)

Reverted

Modified

  • Create new Json ParameterBag Occasion when cloning Request (#44671)
  • Prevents booting suppliers when operating env:decrypt (#44654)

v9.36.3

Reverted

  • Reverts micro-optimization on view occasions (#44653)

Fastened

  • Fixes blade not forgetting compiled views on view:clear (#44643)
  • Fastened Illuminate/Database/Eloquent/Mannequin::offsetExists() (#44642)
  • Overlook element’s cache and manufacturing facility between assessments (#44648)

Modified

  • Bump Testbench dependencies (#44651)

v9.36.2

Fastened

  • Ensures view creators and composers are known as when * is current (#44636)

v9.36.1

Fastened

  • Fixes livewire elements that had been utilizing createBladeViewFromString (#pull)
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments