public function apply($query, $target, $value, $parameters = [])
    {
        $this->model      = $query->getModel();
        $this->parameters = $parameters;

        $targets = $this->parseTargets($target);

        // If there is only a single target, do not group the condition.
        if (count($targets) == 1) {

            $this->applyForSingleTarget($query, head($targets), $value, true);

            return;
        }

        // If we combine with the 'or' operator, group the filter's conditions
        // so the relation with the other filters is kept inclusive.

        $query->where(function ($query) use ($targets, $value) {

            $this->combineOr = true;

            foreach ($targets as $index => $singleTarget) {

                $this->applyForSingleTarget($query, $singleTarget, $value, $index < 1);
            }
        });
    }