Laravel 8.14 Released

Published on by

Laravel 8.14 Released image

The Laravel team released 8.14 with the ability to dispatch unique jobs, support for using sockets with schema:dump, a route shortcut for alphanumeric parameters, and the latest new features, fixes, and changes in the 8.x branch. Let’s see what’s new in this release!

Dispatch Unique Jobs

Paras Malhotra contributed the ability to dispatch unique jobs that are will not dispatch another job with the same key unless the job has completed processing. Here’s an example from the pull request showing how you can use it:

use Illuminate\Contracts\Queue\ShouldBeUnique;
 
class MyUniqueJob implements ShouldQueue, ShouldBeUnique
{
/**
* The number of seconds after which the job will no longer stay unique.
*
* @var int
*/
public $uniqueFor = 3600;
 
public function uniqueId()
{
return $this->user->id;
}
}

Model encryptUsing Method

Illia Sakovich contributed an encryptUsing model method to define an encrypted to be used with encrypted string casts. Here’s how you might use it to determine the encrypter used:

use Illuminate\Database\Eloquent\Model;
use Illuminate\Encryption\Encrypter;
 
$databaseEncryptionKey = config('database.encryption_key');
$encrypter = new Encrypter($databaseEncryptionKey);
 
Model::encryptUsing($encrypter);

MySQL Dump and Import Using Socket

Lito contributed support for using MySQL sockets with the schema:dump command. Previously you could not dump a schema if MySQL only allows socket connections.

Route Constraints for Alphanumeric

Amit Merchant contributed the whereAlphaNumeric route expression constraint to define route constraints instead of directly using the regex conveniently. Here’s an example:

// Using `where()`
Route::get('user/{name}', function ($name) {
//
})->where('name', '[a-zA-Z0-9]+');
 
 
// New optional syntax
Route::get('user/{name}', function ($name) {
//
})->whereAlphaNumeric('name');

Laravel 8.13 introduced a few route parameter constraint shortcuts you might want to check out!

Release Notes

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

v8.14.0

Added

  • Added ability to dispatch unique jobs (#35042, 2123e60)
  • Added Model::encryptUsing() (#35080)
  • Added support to MySQL dump and import using socket (#35083, c43054b)
  • Allow custom broadcastWith in notification broadcast channel (#35142)
  • Added Illuminate\Routing\CreatesRegularExpressionRouteConstraints::whereAlphaNumeric() (#35154)

Fixed

  • Fixed typo in make:seeder command name inside ModelMakeCommand (#35107)
  • Fix SQL Server grammar for upsert (missing semicolon) (#35112)
  • Respect migration table name in config when dumping schema (110eb15)
  • Respect them when previewing notification (ed4411d)
  • Fix appendable attributes in Blade components (#35131)
  • Remove decrypting array cookies from cookie decrypting (#35130)
  • Turn the eloquent collection into a base collection if mapWithKeys loses models (#35129)

Changed

  • Move dispatching of DatabaseRefreshed event to fire before seeders are run (#35091)
  • Handle returning false from reportable callback (55f0b5e)
  • Update Illuminate\Database\Schema\Grammars\MySqlGrammar::typeTimestamp() (#35143)
  • Remove expectedTables after converting to expectedOutput in PendingCommand (#35163)
  • Change SQLite schema command environment variables to work on Windows (#35164)
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Paragraph

Manage your Laravel app as if it was a CMS – edit any text on any page or in any email without touching Blade or language files.

Visit Paragraph
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
LoadForge logo

LoadForge

Easy, affordable load testing and stress tests for websites, APIs and databases.

LoadForge
Paragraph logo

Paragraph

Manage your Laravel app as if it was a CMS – edit any text on any page or in any email without touching Blade or language files.

Paragraph
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
Bacancy - Staff Augmentation logo

Bacancy - Staff Augmentation

Leave your web app development hustles to the leading IT Staff Augmentation Service Providers. Choose from an extensive pool of 1050+ developers and give yourself the sigh of success you deserve with Bacancy. Get In Touch Today!

Bacancy - Staff Augmentation
DocuWriter.ai logo

DocuWriter.ai

Save hours of manually writing Code Documentation, Comments & DocBlocks, Test suites and Refactoring.

DocuWriter.ai
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
October CMS v3.6 Ships Today, Full of New Features image

October CMS v3.6 Ships Today, Full of New Features

Read article
Laracon EU Videos are now out image

Laracon EU Videos are now out

Read article
Use Google's Gemini AI in Laravel image

Use Google's Gemini AI in Laravel

Read article
PhpStorm is getting a brand new terminal image

PhpStorm is getting a brand new terminal

Read article
Six Essential Plugins for Visual Studio Code image

Six Essential Plugins for Visual Studio Code

Read article
Modularize Your Laravel Application With the Modular Package image

Modularize Your Laravel Application With the Modular Package

Read article