original_string: private function _filterSearch(
          string $search = null,
          string $value = null,
          string $operator = '=',
          string $beforeValue = '',
          string $afterValue = ''
      ): void {
          if ($search) {
              if ($value) {
                  $value = trim($value);
              }
              $search = trim($search);
              // поиск по словам
              $this->_query->where(function ($query) use (
                  $search,
                  $value,
                  $operator,
                  $beforeValue,
                  $afterValue
              ) {
                  /** @var \Illuminate\Database\Eloquent\Builder $query */
                  $tableName = $this->_model->getTable();
                  if ($value) {
                      if (Model::hasColumn($this->_model, $search)) {
                          $query->orWhere($tableName . '.' . $search, $operator, $beforeValue . $value . $afterValue);
                      }
                  } elseif ($this->isStrictMode()) {
                      if (method_exists($this->_model, 'toFieldsAmiGrid')) {
                          $list = $this->_model->toFieldsAmiGrid();
                          foreach ($list as $column) {
                              if (Model::hasColumn($this->_model, $column)) {
                                  $query->orWhere($tableName . '.' . $column, $operator, $beforeValue . $search . $afterValue);
                              }
                          }
                      }
                  } else {
                      $list = \Schema::getColumnListing($tableName);
                      foreach ($list as $column) {
                          if ($this->_hasFilterExecuteForCyrillicColumn($search, $column)) {
                              continue;
                          }
                          if (Model::hasColumn($this->_model, $column)) {
                              $query->orWhere($tableName . '.' . $column, $operator, $beforeValue . $search . $afterValue);
                          }
                      }
                  }
              });
          }
      }
code: private function _filterSearch(
          string $search = null,
          string $value = null,
          string $operator = '=',
          string $beforeValue = '',
          string $afterValue = ''
      ): void {
          if ($search) {
              if ($value) {
                  $value = trim($value);
              }
              $search = trim($search);
              // поиск по словам
              $this->_query->where(function ($query) use (
                  $search,
                  $value,
                  $operator,
                  $beforeValue,
                  $afterValue
              ) {
                  /** @var \Illuminate\Database\Eloquent\Builder $query */
                  $tableName = $this->_model->getTable();
                  if ($value) {
                      if (Model::hasColumn($this->_model, $search)) {
                          $query->orWhere($tableName . '.' . $search, $operator, $beforeValue . $value . $afterValue);
                      }
                  } elseif ($this->isStrictMode()) {
                      if (method_exists($this->_model, 'toFieldsAmiGrid')) {
                          $list = $this->_model->toFieldsAmiGrid();
                          foreach ($list as $column) {
                              if (Model::hasColumn($this->_model, $column)) {
                                  $query->orWhere($tableName . '.' . $column, $operator, $beforeValue . $search . $afterValue);
                              }
                          }
                      }
                  } else {
                      $list = \Schema::getColumnListing($tableName);
                      foreach ($list as $column) {
                          if ($this->_hasFilterExecuteForCyrillicColumn($search, $column)) {
                              continue;
                          }
                          if (Model::hasColumn($this->_model, $column)) {
                              $query->orWhere($tableName . '.' . $column, $operator, $beforeValue . $search . $afterValue);
                          }
                      }
                  }
              });
          }
      }
code_tokens: private function _filterSearch ( string $ search = null , string $ value = null , string $ operator = '=' , string $ beforeValue = '' , string $ afterValue = '' ) : void { if ( $ search ) { if ( $ value ) { $ value = trim ( $ value ) ; } $ search = trim ( $ search ) ; // поиск по словам $ this -> _query -> where ( function ( $ query ) use ( $ search , $ value , $ operator , $ beforeValue , $ afterValue ) { /** @var \Illuminate\Database\Eloquent\Builder $query */ $ tableName = $ this -> _model -> getTable ( ) ; if ( $ value ) { if ( Model :: hasColumn ( $ this -> _model , $ search ) ) { $ query -> orWhere ( $ tableName . '.' . $ search , $ operator , $ beforeValue . $ value . $ afterValue ) ; } } elseif ( $ this -> isStrictMode ( ) ) { if ( method_exists ( $ this -> _model , 'toFieldsAmiGrid' ) ) { $ list = $ this -> _model -> toFieldsAmiGrid ( ) ; foreach ( $ list as $ column ) { if ( Model :: hasColumn ( $ this -> _model , $ column ) ) { $ query -> orWhere ( $ tableName . '.' . $ column , $ operator , $ beforeValue . $ search . $ afterValue ) ; } } } } else { $ list = \ Schema :: getColumnListing ( $ tableName ) ; foreach ( $ list as $ column ) { if ( $ this -> _hasFilterExecuteForCyrillicColumn ( $ search , $ column ) ) { continue ; } if ( Model :: hasColumn ( $ this -> _model , $ column ) ) { $ query -> orWhere ( $ tableName . '.' . $ column , $ operator , $ beforeValue . $ search . $ afterValue ) ; } } } } ) ; } }
docstring: The method filters the data according
  
  @param string|int|null $search
  @param mixed|null      $value       word
  @param string          $operator    equal sign - '=', 'like' ...
  @param string          $beforeValue First sign before value
  @param string          $afterValue  Last sign after value
docstring_tokens: The method filters the data according