the typical join that looks like this:
$users = DB::table('users')
->join('contacts', 'users.id', '=', 'contacts.user_id')
->join('orders', 'users.id', '=', 'orders.user_id')
->select('users.*', 'contacts.phone', 'orders.price')
->get();
is well documented in the laravel docs here like so:
$this join(string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', bool $where = false)
However, I have no idea where this kind of join is documented:
DB::table('users')
->join('contacts', function ($join) {
$join->on('users.id', '=', 'contacts.user_id')->orOn(...);
})
->get();
for example selectSub clearly has a closure in its documentation:
Builder|Builder selectSub(Closure|Builder|string $query, string $as)
background: trying to figure the syntax out here