public function scopeWithToken($query, $flag = true)
    {
        if (! isset($this->DT_Column)) {
            $this->DT_Column = $this->defaultColumn;
        }

        if ($flag) {
            return $query->where($this->DT_Column, '!=', null);
        } else {
            return $query->where($this->DT_Column, '=', null);
        }
    }
public function scopeWithToken($query, $flag = true)
    {
        if (! isset($this->DT_Column)) {
            $this->DT_Column = $this->defaultColumn;
        }

        if ($flag) {
            return $query->where($this->DT_Column, '!=', null);
        } else {
            return $query->where($this->DT_Column, '=', null);
        }
    }
public function scopeWithToken ( $ query , $ flag = true ) { if ( ! isset ( $ this -> DT_Column ) ) { $ this -> DT_Column = $ this -> defaultColumn ; } if ( $ flag ) { return $ query -> where ( $ this -> DT_Column , '!=' , null ) ; } else { return $ query -> where ( $ this -> DT_Column , '=' , null ) ; } }
Scope with token query

@param Builder $query
@param bool $flag
@return Builder
Scope with token query