code: public function where($field, $operator = null, $value = null, $logical = '&&')
      {
          if ($field instanceof Closure) {
              $this->scope->where .= $this->scope->where=='' ? ' (' : $logical.' (';
              call_user_func($field, $this);
              $this->scope->where .= ') ';
          } else {
              $logical = (strlen($this->scope->where) <=1 || substr($this->scope->where, -1)=='(') ? '' : $logical;
              $this->scope->where .= Parser::where($field, $operator, $value, $logical);
          }
          return $this;
      }
docs: Add a basic where clause to the query.
  
  @param  string  $field
  @param  string  $operator
  @param  mixed   $value
  @param  string  $logical
  @return $this