private function isFilterable($filter)
    {
        if (is_string($filter) && ! class_exists($filter)) {
            throw new Exceptions\InvalidFilterException(
                "The [$filter] class does not exits."
            );
        }

        if ( ! in_array(Filterable::class, class_implements($filter))) {
            throw new Exceptions\InvalidFilterException(
                'The filter must be a Closure or a class implementing the Filterable interface.'
            );
        }
    }