News

Laravel 5.6.23 and 5.6.24 Released

Published
Laravel 5.6.23 and 5.6.24 Released image

Release updates

Never miss a Laravel release

Get an email whenever a new Laravel release lands.

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.

Sponsored

tinkerwell logo
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article