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
Laravel News Partners

Laravel Jobs

PHP Developer - Full time w/ benefits, US Only
Northern Virginia or Remote (US Only)
Guidance Residential
Full Stack Developer
Remote
Wehaa.com
Laravel API Developer
Las Vegas, NV (Must work on-site)
V Shred
Laravel Developer (Vue, SQL Server)
Remote
World Trade Organization
Web Application Developer (Vue.js & Laravel)
Remote
Apero Creative Development

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.