Laravel 8.14 Released - What’s new in Laravel 8.14

Laravel 8.14 Released - What’s new in Laravel 8.14

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!

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)

The Original Article can be found on laravel-news.com

laravel php web-development programming developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

PHP Web Application Development Company

As a top **PHP Web Application Development Company in USA**[https://www.dataeximit.com/php-development-services/](https://www.dataeximit.com/php-development-services/ "https://www.dataeximit.com/php-development-services/"), we at Data EximIT have...

PHP Website Development

Skenix Infotech is a leading PHP Web Development Company that helps companies get results with industry best practices. Get affordable PHP Development Services.

Laravel Development Company

Skenix Infotech is a top Laravel Website Development Company with Expert Laravel Developers that provides robust Laravel Development Services at fair costs.

Hire Dedicated PHP Developer

Looking to hire affordable yet experienced PHP developers? **[Hire Dedicated PHP Developer](https://hourlydeveloper.io/hire-dedicated-php-developer/ "Hire Dedicated PHP Developer")**, who can convert your idea to reality, within the stipulated...

Hire PHP Developer

Looking to develop a PHP based website from scratch or revamp your existing website? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** has always been an industry leader for companies and business owners looking to hire...