Laravel 8.20 Released

News

December 24th, 2020

laravel8.jpg

The Laravel team released 8.20 this week with cache lock connection configuration, the ability to provide default values when syncing a pivot table, and the latest changes in the 8.x branch:

Separate Lock Connection for Cache Stores

Paras Malhotra contributed the ability to configure a separate lock connection for cache stores. It’s common to clear caches during things like deployments, however, doing so could break unique jobs or session blocking. You can now use a lock_connection configuration property to define the cache connection used for locks:

1'stores' => [
2 'database' => [
3 'driver' => 'database',
4 'table' => 'cache',
5 'connection' => null,
6 'lock_connection' => 'lock',
7 ],
8 'redis' => [
9 'driver' => 'redis',
10 'connection' => 'cache',
11 'lock_connection' => 'lock',
12 ],
13]

Sync Records With Default Values in Pivot Tables

Daniil Zobov contributed the ability to sync records with default values in pivot tables:

1$server = Server::find(1);
2$ips = Ip::findMany([1,2,3]);
3 
4$server->ips()->syncWithPivotDefaults(
5 $ips,
6 ['vlan' => 1444]
7);

Custom DBAL TimestampType Type

Tom H Anderson and Dries Vints contributed a TimestampType custom mapping type. Check out the release notes below for further details.

Release Notes

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

v8.20.0

Added

  • Added Illuminate\Database\DBAL\TimestampType (a5761d4, cff3705 382445f, 810047e)
  • Added ability to specify a separate lock connection (#35621, 3d95235)
  • Added Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithPivotTable::syncWithPivotValues() (#35644, 49b3ce0)

Fixed

  • Fixed Illuminate\Validation\Concerns\ValidatesAttributes::validateJson() for PHP8 (#35646)
  • Fixed assertCookieExpired() and assertCookieNotExpired() methods in Illuminate\Testing\TestResponse (#35637)
  • Fixed: Account for a numerical array of views in Mailable::renderForAssertions() (#35662)
  • Catch DecryptException with invalid X-XSRF-TOKEN in Illuminate\Foundation\Http\Middleware\VerifyCsrfToken (#35671)

Changed

  • Check configuration in Illuminate\Foundation\Console\Kernel::scheduleCache() (a253d0e)
  • Modify Model::mergeCasts to return $this (#35683)
  • Clear a cached user in RequestGuard if a request is changed (#35692)

Filed in:

Paul Redmond

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