src/Jedrzej/Searchable/SearchableTrait.php
protected function isFieldSearchable(Builder $builder, $field)
    {
        $searchable = $this->_getSearchableAttributes($builder);
        $notSearchable =  $this->_getNotSearchableAttributes($builder);

        $field = preg_replace('#^!#', '', $field);

        return !in_array($field, $notSearchable) && !in_array('*', $notSearchable) && (in_array($field, $searchable) || in_array('*', $searchable));
    }
protected function isFieldSearchable(Builder $builder, $field)
    {
        $searchable = $this->_getSearchableAttributes($builder);
        $notSearchable =  $this->_getNotSearchableAttributes($builder);

        $field = preg_replace('#^!#', '', $field);

        return !in_array($field, $notSearchable) && !in_array('*', $notSearchable) && (in_array($field, $searchable) || in_array('*', $searchable));
    }
protected function isFieldSearchable ( Builder $ builder , $ field ) { $ searchable = $ this -> _getSearchableAttributes ( $ builder ) ; $ notSearchable = $ this -> _getNotSearchableAttributes ( $ builder ) ; $ field = preg_replace ( '#^!#' , '' , $ field ) ; return ! in_array ( $ field , $ notSearchable ) && ! in_array ( '*' , $ notSearchable ) && ( in_array ( $ field , $ searchable ) || in_array ( '*' , $ searchable ) ) ; }
Check if field is searchable for given model.

@param Builder $builder query builder
@param string  $field   field name

@return bool
Check if field is searchable for given model .