Laravel 9.27 Released

Laravel 9.27 Released

Laravel 9.27 released with DatabaseBatchRepository getter and setter methods. There are some minor fixes releases, like non-backed enums, nested array validation rule, and event listeners registering callback. Let’s check these updates in detail here:

1. DatabaseBatchRepository class getter and setter methods for connection:

Abrar Ahmad contributed to Adding support for Laravel job batches which are temporarily replacing BatchRepository connection with correct tenant connection and then reverting it back when exiting the tenant context.

Before:

$batchRepositoryReflection = new ReflectionClass($batchRepository);
$connectionProperty        = $batchRepositoryReflection->getProperty('connection');
$connectionProperty->setAccessible(true);
$connection = $connectionProperty->getValue($batchRepository);

$this->previousConnection = $connection;

$connectionProperty->setValue($batchRepository, DB::connection('tenant'));

After:

$this->previousConnection = $batchRepository->getConnection();
$batchRepository->setConnection(DB::connection('tenant'));

Source File Edits: src/Illuminate/Bus/DatabaseBatchRepository.php

  • setConnection
/**
 * Set the desired connection for the batch.
 *
 * @param  \Illuminate\Database\Connection  $connection
 * @return void
 */
public function setConnection(Connection $connection)
{
    $this->connection = $connection;
}
  • getConnection
/**
 * Get the underlying database connection.
 *
 * @return \Illuminate\Database\Connection
 */
public function getConnection()
{
    return $this->connection;
}

That is the only update comes in the Laravel 9.27 Release. But more will be coming up in future updates.

Now the list of the Laravel 9.26 Released updates:

Added

  • Add getter and setter for connection in the DatabaseBatchRepository class (#43869)

Fixed

  • Fix for potential bug with non-backed enums (#43842)
  • Patch nested array validation rule regression bug (#43897)
  • Fix registering event listeners with array callback (#43890)

Changed

  • Explicitly add column name to SQLite query in Illuminate/Database/Console/DatabaseInspectionCommand::getSqliteTableSize() (#43832)
  • Allow broadcast on demand notifications (d2b1446)
  • Make Vite::hotFile() public (#43875)
  • Prompt to create sqlite db when migrating (#43867)
  • Call prepare() on HttpException responses (#43895)
  • Make the model:prune command easier to extend (#43919)

To get to know more about Laravel, you can check these articles too.

You can check the latest release tech articles like Laravel 9.27 Released here.

Please follow and like us:

Related Posts

Leave a Reply

Share