
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
toRule::in()
andRule::notIn()
(#23875)
Fixed
- Lock Carbon version at
1.25.*
(27b8844)
Removed
- Removed form error for password confirmation (#23887)
Newsletter

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

- Software Developer
-
Remote (US & Canada)
Alley - 😎 Laravel Developer
-
Remote
Jogg, Inc - Junior, Mid, and Senior Software Engineers. Laravel / Vue. Saint Petersburg, FL
-
Saint Petersburg, FL and Remote
ShineOn - Senior PHP Developer (Laravel)
-
Remote
The Interaction Design Foundation - Fullstack Laravel Engineer (Munich/Remote) 💻
-
Munich, Germany or Remote
AirLST GmbH
Cascading Soft Deletes with Laravel 5
Laravel Soft Cascade is a package that makes it easy to perform soft cascade deletes and restores on related models u…
VuePress: A Vue-powered Static Site Generator
VuePress is a minimalistic Vue-powered static site generator from Evan You, the creator of Vue.js. VuePress was built…