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

whereNull() public method

Add a "where null" clause to the query.
public whereNull ( string $column, string $boolean = 'and', boolean $not = false )
$column string
$boolean string
$not boolean
    public function whereNull($column, $boolean = 'and', $not = false)
    {
        $type = $not ? 'NotNull' : 'Null';
        $this->wheres[] = compact('type', 'column', 'boolean');
        return $this;
    }

Usage Example

 /**
  * Add a "where" clause to the given query.
  *
  * @param  \Illuminate\Database\Query\Builder $query
  * @param  string $key
  * @param  string $extraValue
  * @return void
  */
 protected function addWhere($query, $key, $extraValue)
 {
     if ($extraValue === 'NULL') {
         $query->whereNull($key);
     } elseif ($extraValue === 'NOT_NULL') {
         $query->whereNotNull($key);
     } else {
         $query->where($key, $extraValue);
     }
 }
All Usage Examples Of Illuminate\Database\Query\Builder::whereNull