Laravel 5.6.17 Released

Laravel 5.6.17 Released

Last week Laravel released version 5.6.17 with helpers to make subquery joins more straightforward, along with a few minor changes and locking Carbon at 1.25.* on the Laravel 5.6 branch.

Pull request #23818 adds helpers for subquery join clauses, including the joinSub(), leftJoinSub() and rightJoinSub() methods to the query builder.

According to the PR, before this feature, subquery joins were possible through raw SQL:

$query = DB::table('subtable');
$sql = '(' . $query->toSql() . ') as "sub"';
DB::table('table')->join(DB::raw($sql), ...);

With the new helpers you can create subquery joins with raw SQL, a closure, or a query builder:

DB::table('table')->joinSub('select * from "subtable"', 'sub', ...);
DB::table('table')->joinSub(function ($q) { $q->from('subtable'); }, 'sub', ...);
DB::table('table')->joinSub(DB::table('subtable')->where('foo', 'bar'), 'sub', ...);

Next up, a change was made to the validation Rule class, allowing you to pass a collection to the Rule::in() and Rule::notIn():

use Illuminate\Validation\Rule;

// A collection...
$zones = collect(['first-zone', 'second-zone']);

Validator::make($data, [
    'zones' => [
        'required',
        Rule::in($zones),
    ],
]);

Here are the full release notes for Laravel 5.6.17:

v5.6.17 (2018-04-17)

Added

  • Added helpers for subquery joins (#23818)

Changed

  • Allow PendingResourceRegistration to be fluently registered (#23890)
  • Allow asserting an integer with assertSee*() (#23892)
  • Allow passing Collection to Rule::in() and Rule::notIn() (#23875)

Fixed

  • Lock Carbon version at 1.25.* (27b8844)

Removed

  • Removed form error for password confirmation (#23887)


Filed in: News / Releases


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

PHP Data Engineer
Remote (US)
FBS
Software Developer
Remote (US & Canada)
Alley
Backend Software Engineer
Remote (UTC +/- 5)
Smartbnb
Programmer
Remote (Overlap w/ Continental US Time Zones)
Tighten
Senior Backend Engineer
Remote
64 Robots
Senior Laravel Developer
Atlanta, GA
Helium LLC
Full-Stack Developer (JS - Vue.js, PHP - Laravel)
US Remote / Telecommute
TTEC Digital