Illuminate\Database\Query\Builder::leftJoin PHP Method

leftJoin() public method

Add a left join to the query.
public leftJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
return Builder | static
    public function leftJoin($table, $first, $operator = null, $second = null)
    {
        return $this->join($table, $first, $operator, $second, 'left');
    }

Usage Example

Example #1
0
 /**
  * @param $table
  * @param $key $table.key
  * @param bool $fkey $this->table.key
  * @return $this
  */
 public function leftJoinOn($table, $key, $fkey = false)
 {
     $fkey = $fkey ?: $key;
     $key = starts_with($key, $table . '.') ? $key : $table . '.' . $key;
     $fkey = starts_with($key, $this->table . '.') ? $fkey : $this->table . '.' . $fkey;
     $this->operator = $this->operator->leftJoin($table, $key, '=', $fkey);
     return $this;
 }
All Usage Examples Of Illuminate\Database\Query\Builder::leftJoin