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
Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes.

Visit Larafast: Laravel SaaS Starter Kit
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
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
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
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
Anonymous Event Broadcasting in Laravel 11.5 image

Anonymous Event Broadcasting in Laravel 11.5

Read article
Microsoft Clarity Integration for Laravel image

Microsoft Clarity Integration for Laravel

Read article
Apply Dynamic Filters to Eloquent Models with the Filterable Package image

Apply Dynamic Filters to Eloquent Models with the Filterable Package

Read article
Property Hooks Get Closer to Becoming a Reality in PHP 8.4 image

Property Hooks Get Closer to Becoming a Reality in PHP 8.4

Read article
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article