private static function validateFilterItem($filter, $settings)
    {
        // Convert string to filter array.
        if (!is_array($filter)) {
            $filter = ['', $filter];
        }

        // Convert string to filter array.
        if (Arr::get($settings, 'filter') !== 'boolean' && count($filter) == 1) {
            array_unshift($filter, '');
        }

        // Split the filter array into operator, value1, value2
        $operator = Arr::get($filter, 0, '');
        $value_one = Arr::get($filter, 1, false);
        $value_two = Arr::get($filter, 2, false);

        // The wild-all setting was enabled.
        // Update value with all characters wildcarded.
        if (Arr::has($settings, 'enable.wild-all')) {
            self::applyWildAll($operator, $value_one);
        }

        self::checkInlineOperator($operator, $value_one, $settings);
        self::checkNullOperator($operator, $value_one);
        self::checkEmptyOperator($operator, $value_one);

        // Defaullt operator.
        if (empty($operator)) {
            $operator = self::getDefaultOperator(Arr::get($settings, 'filter'), $operator);
        }

        // Return filter as an associative array.
        $filter = [
            'operator'  => $operator,
            'method'    => 'where',
            'arguments' => [],
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => true,
        ];

        // Update filter based on the filter being used.
        $validation_method = 'filterBy'.Str::studly(Arr::get($settings, 'filter'));

        if (method_exists(__CLASS__, $validation_method)) {
            $filter = self::{$validation_method}($filter);
        }

        if ($filter === false) {
            return $filter;
        }

        // Update based on operator.
        $filter['positive'] = !(stripos($operator, '!') !== false || stripos($operator, 'NOT') !== false);

        return $filter;
    }
private static function validateFilterItem($filter, $settings)
    {
        // Convert string to filter array.
        if (!is_array($filter)) {
            $filter = ['', $filter];
        }

        // Convert string to filter array.
        if (Arr::get($settings, 'filter') !== 'boolean' && count($filter) == 1) {
            array_unshift($filter, '');
        }

        // Split the filter array into operator, value1, value2
        $operator = Arr::get($filter, 0, '');
        $value_one = Arr::get($filter, 1, false);
        $value_two = Arr::get($filter, 2, false);

        // The wild-all setting was enabled.
        // Update value with all characters wildcarded.
        if (Arr::has($settings, 'enable.wild-all')) {
            self::applyWildAll($operator, $value_one);
        }

        self::checkInlineOperator($operator, $value_one, $settings);
        self::checkNullOperator($operator, $value_one);
        self::checkEmptyOperator($operator, $value_one);

        // Defaullt operator.
        if (empty($operator)) {
            $operator = self::getDefaultOperator(Arr::get($settings, 'filter'), $operator);
        }

        // Return filter as an associative array.
        $filter = [
            'operator'  => $operator,
            'method'    => 'where',
            'arguments' => [],
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => true,
        ];

        // Update filter based on the filter being used.
        $validation_method = 'filterBy'.Str::studly(Arr::get($settings, 'filter'));

        if (method_exists(__CLASS__, $validation_method)) {
            $filter = self::{$validation_method}($filter);
        }

        if ($filter === false) {
            return $filter;
        }

        // Update based on operator.
        $filter['positive'] = !(stripos($operator, '!') !== false || stripos($operator, 'NOT') !== false);

        return $filter;
    }
private static function validateFilterItem ( $ filter , $ settings ) { // Convert string to filter array. if ( ! is_array ( $ filter ) ) { $ filter = [ '' , $ filter ] ; } // Convert string to filter array. if ( Arr :: get ( $ settings , 'filter' ) !== 'boolean' && count ( $ filter ) == 1 ) { array_unshift ( $ filter , '' ) ; } // Split the filter array into operator, value1, value2 $ operator = Arr :: get ( $ filter , 0 , '' ) ; $ value_one = Arr :: get ( $ filter , 1 , false ) ; $ value_two = Arr :: get ( $ filter , 2 , false ) ; // The wild-all setting was enabled. // Update value with all characters wildcarded. if ( Arr :: has ( $ settings , 'enable.wild-all' ) ) { self :: applyWildAll ( $ operator , $ value_one ) ; } self :: checkInlineOperator ( $ operator , $ value_one , $ settings ) ; self :: checkNullOperator ( $ operator , $ value_one ) ; self :: checkEmptyOperator ( $ operator , $ value_one ) ; // Defaullt operator. if ( empty ( $ operator ) ) { $ operator = self :: getDefaultOperator ( Arr :: get ( $ settings , 'filter' ) , $ operator ) ; } // Return filter as an associative array. $ filter = [ 'operator' => $ operator , 'method' => 'where' , 'arguments' => [ ] , 'value_one' => $ value_one , 'value_two' => $ value_two , 'settings' => $ settings , 'positive' => true , ] ; // Update filter based on the filter being used. $ validation_method = 'filterBy' . Str :: studly ( Arr :: get ( $ settings , 'filter' ) ) ; if ( method_exists ( __CLASS__ , $ validation_method ) ) { $ filter = self :: { $ validation_method } ( $ filter ) ; } if ( $ filter === false ) { return $ filter ; } // Update based on operator. $ filter [ 'positive' ] = ! ( stripos ( $ operator , '!' ) !== false || stripos ( $ operator , 'NOT' ) !== false ) ; return $ filter ; }
Validate each entry.

@param array|string $filter
@param array        $settings

@return array|null
Validate each entry .