Laravel 5.6.17 Released
Published on by Paul Redmond
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)