public static function countByRequest(array $criteria = [])
    {
        if (!empty($condition = array_get($criteria, 'condition'))) {
            $params = array_get($criteria, 'params', []);

            return static::whereRaw($condition, $params)->count();
        }

        return static::count();
    }
public static function countByRequest(array $criteria = [])
    {
        if (!empty($condition = array_get($criteria, 'condition'))) {
            $params = array_get($criteria, 'params', []);

            return static::whereRaw($condition, $params)->count();
        }

        return static::count();
    }
public static function countByRequest ( array $ criteria = [ ] ) { if ( ! empty ( $ condition = array_get ( $ criteria , 'condition' ) ) ) { $ params = array_get ( $ criteria , 'params' , [ ] ) ; return static :: whereRaw ( $ condition , $ params ) -> count ( ) ; } return static :: count ( ) ; }
Performs a COUNT query based on query criteria supplied from api request.

@param array $criteria

@return int
Performs a COUNT query based on query criteria supplied from api request .