News

Laravel 5.8.4 Released

Published
Laravel 5.8.4 Released image

Release updates

Never miss a Laravel release

Get an email whenever a new Laravel release lands.

The Laravel team released v5.8.4 yesterday with a new collection join method and an HTTP Kernel middleware getter.

First, the new Collect::join() method to join all items from the collection using a string. The final item can use a separate “glue” string as well:

collect(['a', 'b', 'c']))->join(', ')); // returns 'a, b, c'
 
collect(['a', 'b', 'c']))->join(', ', ' and ')); // returns 'a, b and c'
 
collect(['a', 'b']))->join(', ', ' and ')); // returns 'a and b'
 
collect(['a']))->join(', ', ' and ')); // returns 'a'
 
collect([]))->join(', ', ' and ')); // returns ''

Next, the HTTP Kernel class has a new getRouteMiddleware() method which could come in handy to ensure that a middleware has been registered:

/** @test */
public function it_registers_a_custom_route_middleware()
{
$middlewares = resolve(\App\Http\Kernel::class)->getRouteMiddleware();
 
$this->assertArrayHasKey('custom', $middlewares);
$this->assertEquals(\App\Http\Middleware\Custom::class, $middlewares['custom']);
}

The last new addition is adding Danish-specific characters to the Str class for proper support when the language is da. Here’s the list of characters from the PR:

'da' => [
['ø', 'å', 'Æ', 'Ø', 'Å'],
['oe', 'aa', 'Ae', 'Oe', 'Aa'],
],

An important fix is for JSON boolean queries ships in v5.8.4. Laravel’s 5.8 un-quoting of JSON values with MySQL broke boolean comparisons. For full details check out PR #27847.

You can see the full list of fixes below, and the whole diff between 5.8.4 and 5.8.3 on GitHub. The full release notes for Laravel 5.7 are available in the GitHub 5.8 changelog:

v5.8.4

Added

  • Added Illuminate\Support\Collection::join() method (#27723)
  • Added Illuminate\Foundation\Http\Kernel::getRouteMiddleware() method (#27852)
  • Added danish specific transliteration to Str class (#27857)

Fixed

  • Fixed JSON boolean queries (#27847)
Paul Redmond photo

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

Sponsored

laravelcloud logo
Laravel Cloud

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

Visit Laravel Cloud

The latest

View all →
PayZephyr: One Payment API for Stripe, Paystack, and PayPal image

PayZephyr: One Payment API for Stripe, Paystack, and PayPal

Read article
Bifrost Turns One With AI Builds and New Workflows image

Bifrost Turns One With AI Builds and New Workflows

Read article
Preview Blade Templates in macOS Finder with Quick Blade image

Preview Blade Templates in macOS Finder with Quick Blade

Read article
Artisan Debugging Commands in Laravel Telescope 5.24.0 image

Artisan Debugging Commands in Laravel Telescope 5.24.0

Read article
Queue totalSize() and JobInterrupted Event in Laravel 13.31 image

Queue totalSize() and JobInterrupted Event in Laravel 13.31

Read article
Find Unexpected Test Inputs with Fuzz for Pest image

Find Unexpected Test Inputs with Fuzz for Pest

Read article