Laravel 5.6.23 and 5.6.24 Released

Published on by

Laravel 5.6.23 and 5.6.24 Released image

Two new releases are available for the Laravel framework since we covered Laravel 5.6.22 so let’s see what’s new in the latest versions of Laravel 5.6.

Laravel 5.6.23 Highlights

Laravel v5.6.23—released about 12 days ago—adds the ability to rename database indices, a new event fake, a @canany directive, and a TestResponse:: assertLocation() method.

Renaming indices are supported by calling the renameIndex method with the first argument being the existing index, and the second argument being the new index name:

$table->renameIndex('account', 'account_id') // rename to account_id

In MySQL, Postgres, and MS SQL, renaming indices is a native call. In SQLite, this new change is accomplished by dropping the original index and re-creating a new index.

Next up, a new Event::fakeFor method allows you to fake events for only a specific part:

Event::fakeFor(function () {
return factory(Subscription::class)->create();
}, [OnlyThisEvent::class]);

A new @canany (can any?) directive allows you to check an action conditionally:

@canany(['edit_post', 'delete_post'])
{{-- proceed --}}
@else
{{-- denied --}}
@endcanany

The last new feature in Laravel 5.6.23 is a new TestResponse::assertLocation() assertion:

$response->assertLocation('/orders/1');

Laravel 5.6.24 Highlights

Laravel v5.6.24 shipped on Monday, June 4th with six new features, along with some changes and fixes.

First up is a new test helper method for asserting if the session is error-free:

$this->assertSessionHasNoErrors();

Next up is added support for defining and enforcing a Spatial reference system for a Point column, which I admittedly know nothing about and defer to the PR :)

As of Mysql 8, there is support for spatial reference systems. Currently, there is no way to create a Point column that refers to a specific SRS.

The benefit of having this, is to ensure that when using point datatypes for geocoordinates, they on the correct scale. By default, the column will refer to SRID 0, and when doing calculations ( e.g., the distance between points ) the resulting deviation is huge.

Next, two new query builder methods were added for querying JSON:

$query->whereJsonNotContains('options->languages', ['en']);
$query->orWhereJsonNotContains('options->languages', ['en']);

The SerializesModels and Queueable traits were added to all notification events. From the PR:

Sometimes the $notifiable model in these events have a bunch of extra stuff on it (relationships, etc.) added during a flow and all of this data is being unnecessarily added to queued jobs, from the listeners. This can cause issues for queueing systems because the jobs can have huge payloads.

Route definitions can now use the callable array syntax:

Route::get('smth', [SomeController::class, 'methodName']);

If you prefer the ability to navigate to controller more efficiently in an IDE, this style might suit you.

The last new change in this release is adding JSON SELECT queries to SQL Server 2016+:

DB::table('users')
->select('items->price')
->where('items->price', 1)
->orderBy('items->price');

Thank you to all the contributors to the latest releases, we see some nice incremental changes in every version!

Here’s the full changelog for both 5.6.23 and 5.6.24:

v5.6.24 (2018-06-04)

Added

  • Added assertSessionHasNoErrors() test helper (#24308)
  • Added support for defining and enforcing a Spatial reference system for a Point column (#24320)
  • Added Builder::whereJsonDoesntContain() and Builder::orWhereJsonDoesntContain() (#24367)
  • Added Queueable, SerializesModels to all notification events (#24368)
  • Allow callable array syntax in route definition (#24385)
  • Added JSON SELECT queries to SQL Server (#24397)

Changed

  • Optimize query builder’s pluck() method (#23482)
  • Allow passing object instances regardless of the parameter name to method injection (#24234)
  • Extract setting mutated attribute into method (#24307)
  • Let apiResource support except option (#24319)
  • Skip null/empty values in SeeInOrder (#24395)
  • Sync Original modal attributes after soft deletion (#24400)

Fixed

  • Fixed typo of missing underscore in not_regexp rule name (#24297)
  • Cleanup null relationships in loadMorph (#24322)
  • Fix loadMissing() relationship parsing (#24329)
  • Fix FormRequest class authorization validation priority (#24369)
  • Fix custom blade conditional ignoring 0 as argument (#24394)

v5.6.23 (2018-05-24)

Added

  • Added support for renaming indices (#24147)
  • Added Event::fakeFor() method (#24230)
  • Added @canany Blade directive (#24137)
  • Added TestReponse::assertLocation() method (#24267)

Changed

  • Validation bypass for before and after rules when paired with date_format rule (#24191)

Fixed

  • Fixed an issue with Cache::increment() when expiration is null (#24228)
  • Ignore non-where bindings in nested where constraints (#24000)
  • Fixed withCount() binding problems (#24240)
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
No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project.

Visit No Compromises
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 →
Add Kanban Boards to Your Laravel App in Seconds image

Add Kanban Boards to Your Laravel App in Seconds

Read article
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