src/Matthenning/EloquentApiFilter/EloquentApiFilter.php
private function applyWhereClause(Builder $query, $field, $operator, $value, $or = false) {
        $verb = $or ? 'orWhere' : 'where';
        $null_verb = $or ? 'orWhereNull' : 'whereNull';
        $not_null_verb = $or ? 'orWhereNotNull' : 'whereNotNull';

        $value = $this->base64decodeIfNecessary($value);

        switch ($value) {
            case 'today':
                return $query->$verb($field, 'like', Carbon::now()->format('Y-m-d') . '%');
            case 'nottoday':
                return $query->$verb(function ($q) use ($field) {
                    $q->where($field, 'not like', Carbon::now()->format('Y-m-d') . '%')
                        ->orWhereNull($field);
                });
            case 'null':
                return $query->$null_verb($field);
            case 'notnull':
                return $query->$not_null_verb($field);
            default:
                return $query->$verb($field, $operator, $value);
        }
    }
private function applyWhereClause(Builder $query, $field, $operator, $value, $or = false) {
        $verb = $or ? 'orWhere' : 'where';
        $null_verb = $or ? 'orWhereNull' : 'whereNull';
        $not_null_verb = $or ? 'orWhereNotNull' : 'whereNotNull';

        $value = $this->base64decodeIfNecessary($value);

        switch ($value) {
            case 'today':
                return $query->$verb($field, 'like', Carbon::now()->format('Y-m-d') . '%');
            case 'nottoday':
                return $query->$verb(function ($q) use ($field) {
                    $q->where($field, 'not like', Carbon::now()->format('Y-m-d') . '%')
                        ->orWhereNull($field);
                });
            case 'null':
                return $query->$null_verb($field);
            case 'notnull':
                return $query->$not_null_verb($field);
            default:
                return $query->$verb($field, $operator, $value);
        }
    }
private function applyWhereClause ( Builder $ query , $ field , $ operator , $ value , $ or = false ) { $ verb = $ or ? 'orWhere' : 'where' ; $ null_verb = $ or ? 'orWhereNull' : 'whereNull' ; $ not_null_verb = $ or ? 'orWhereNotNull' : 'whereNotNull' ; $ value = $ this -> base64decodeIfNecessary ( $ value ) ; switch ( $ value ) { case 'today' : return $ query -> $ verb ( $ field , 'like' , Carbon :: now ( ) -> format ( 'Y-m-d' ) . '%' ) ; case 'nottoday' : return $ query -> $ verb ( function ( $ q ) use ( $ field ) { $ q -> where ( $ field , 'not like' , Carbon :: now ( ) -> format ( 'Y-m-d' ) . '%' ) -> orWhereNull ( $ field ) ; } ) ; case 'null' : return $ query -> $ null_verb ( $ field ) ; case 'notnull' : return $ query -> $ not_null_verb ( $ field ) ; default : return $ query -> $ verb ( $ field , $ operator , $ value ) ; } }
Applies a where clause.
Is used by applyFilter and applyNestedFilter to apply the clause to the query.

@param Builder $query
@param $field
@param $operator
@param $value
@param $or = false
@return Builder
Applies a where clause . Is used by applyFilter and applyNestedFilter to apply the clause to the query .