/**
  * Modify the table's query using the filters.
  *
  * @param TableBuilder    $builder
  * @param FilterInterface $filter
  * @param Builder         $query
  */
 public function filter(TableBuilder $builder, FilterInterface $filter, Builder $query)
 {
     /**
      * If the filter is self handling then let
      * it filter the query itself.
      */
     if ($filter instanceof SelfHandling) {
         $this->container->call([$filter, 'handle'], compact('builder', 'query', 'filter'));
         return;
     }
     $handler = $filter->getQuery();
     // Self handling implies @handle
     if (is_string($handler) && !str_contains($handler, '@') && class_implements($handler, SelfHandling::class)) {
         $handler .= '@handle';
     }
     /**
      * If the handler is a callable string or Closure
      * then call it using the IoC container.
      */
     if (is_string($handler) || $handler instanceof \Closure) {
         $this->container->call($handler, compact('builder', 'query', 'filter'));
     }
 }