Register the breadcrumb for the create/edit page.

@param Rule $rule
@throws \DaveJamesMiller\Breadcrumbs\Exception
778826
public function onForm(Rule $rule)
    {
        $this->onIndex();

        $name = $rule->exists ? 'rule-' . $rule->getValue() : 'rule-add';

        $this->breadcrumbs->register($name, function(Generator $breadcrumbs) use($rule) {
            $trans = 'antares/ban_management::messages.breadcrumbs';
            $name  = $rule->exists ? trans($trans . '.ip_edit', ['ip' => $rule->getValue()]) : trans($trans . '.ip_create');
            $breadcrumbs->parent(self::$name . '-rules');
            $breadcrumbs->push($name);
        });

        $this->shareOnView($name);
    }
359943
private function registerBreadcrumbsService()
    {
        $this->singleton(Contracts\Breadcrumbs::class, function ($app) {
            /** @var  \Illuminate\Contracts\Config\Repository  $config */
            $config = $app['config'];

            return new Breadcrumbs(
                $config->get('breadcrumbs.template.supported', []),
                $config->get('breadcrumbs.template.default', '')
            );
        });
    }
1247451
public function addLexerRule($rulename, $rule)
	{
		$this->rules[$rulename] = [];
		$this->rules[$rulename][] = $rule; 
	}
1137447
public function addRule($name, callable $rule)
    {
        if (isset($this[self::rule($name)])) {
            throw new \RuntimeException("rule '$name' already exists'");
        }
        $this[self::rule($name)] = $this->protect($rule);
    }
1267674
public function addRules(Rule ...$rules): MutableQuery
    {
        $cloned = clone $this;

        $activeRules = iterator_to_array($this->rules);
        $activeRules = array_merge($activeRules, $rules);

        $cloned->rules = new RuleCollection($this->rules->getJoinKeyword(), ...$activeRules);

        return $cloned;
    }
362190
public function apply(Rule $rule, $value)
    {
        $type = $rule->getInputType();

        if ($type == CallbackRule::SELF_METHOD_TYPE) {
            return $this->useObjectMethod($rule->callback, $value);
        }

        if ($type == CallbackRule::CALLABLE_TYPE) {
            return $this->useCallable($rule->callback, $value);
        }

        if ($type == CallbackRule::CLOSURE_TYPE) {
            return $this->useClosure($rule->callback, $value);
        }

        throw new InvalidCallbackException("Unsupported callback provided, failed to filter property");
    }
813838
public function updateRuleData(Rule $rule): void
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->update('ngbm_rule_data')
            ->set('enabled', ':enabled')
            ->set('priority', ':priority')
            ->where(
                $query->expr()->eq('rule_id', ':rule_id')
            )
            ->setParameter('rule_id', $rule->id, Type::INTEGER)
            ->setParameter('enabled', $rule->enabled, Type::BOOLEAN)
            ->setParameter('priority', $rule->priority, Type::INTEGER);

        $query->execute();
    }
171733
private function validateRule($rule): bool
    {
        if ($rule instanceof \Closure || $rule instanceof RuleInterface) {
            return true;
        }

        if (is_array($rule)) {
            return is_callable($rule, true);
        }

        if (is_string($rule) && class_exists($rule)) {
            try {
                $reflection = new \ReflectionClass($rule);
            } catch (\ReflectionException $e) {
                return false;
            }

            return $reflection->isSubclassOf(RuleInterface::class);
        }

        return false;
    }
1265354
public function addRule(RuleAbstract $rule)
    {
        // Check for allowed instances
        if ($rule instanceof RuleGroupableInterface) {
            $this->rules[] = $rule;
        } else {
            // Invalid rule instance, because only nested statements can be added to conditional group rules.
            $parentClassName = get_class($this);
            $childClassName = get_class($rule);
            $rule->setIsValid(false);
            $rule->addValidationError(
                "Rule instance of type '$childClassName' not allowed " .
                "in conditional group rule of type '$parentClassName'."
            );
            $this->rules[] = $rule;
        }

        return $this;
    }
388412
public function apply(Rule $rule, $value)
    {
        //Build pattern
        $pattern = ($this->checkUnicodeSupport() && $rule->unicodePattern !== null)
            ? $rule->unicodePattern
            : $rule->pattern;

        return preg_replace($pattern, '', $value);
    }
797861
protected function registerBreadcrumbs($container, array $item = [])
    {
        $this->setBreadcrumbsContainer($container);

        breadcrumbs()->register('main', function(Builder $bc) use ($item) {
            if (empty($item)) {
                $item = $this->getBreadcrumbsHomeItem();
            }

            $bc->push($item['title'], $item['url'], $item['data'] ?? []);
        });
    }
1162318
public function addBreadcrumb()
    {
        $this->updateBreadcrumbNode();

        $nodeId = $this->session->get('tl_page_node');

        if ($nodeId < 1) {
            return;
        }

        $trail = $this->getBreadcrumbTrail($nodeId);

        // Generate breadcrumb trail
        if (0 === count($trail)) {
            $this->session->set('tl_page_node', 0);

            return;
        }

        $this->checkTrailAccess($nodeId, $trail);
        $this->buildBreadcrumb($nodeId, $trail);
    }
1280318
public function addRuleToAll(ValidatorRule $rule, $position = self::APPEND) {
    if ($position == self::APPEND) {
      foreach ($this->rules as $key => $NULL) {
        array_push($this->rules[$key],$rule);
      }
    }
    
    if ($position == self::PREPEND) {
      foreach ($this->rules as $key => $NULL) {
        array_unshift($this->rules[$key], $rule);
      }
    }
    
    if (is_numeric($position)) {
      foreach ($this->rules as $key => $NULL) {
        A::insert($this->rules[$key], $rule, (int) $position);
      }
    }
    
    throw new \Psc\Exception('unbekanter Parameter für position: '.Code::getInfo($position));
  }
1072673
public function update($rule)
    {
        $ruleId = "";

        if (is_array($rule)) {
            $ruleId = $rule["id"];
            unset($rule["id"]);
        }
        elseif (is_object($rule)) {
            $ruleId = $rule->id;
            unset($rule->id);
        }

        return $this->client->put("/validation-rules/" . rawurlencode($ruleId), $rule);
    }
785496
public function addRule($configuration, RuleInterface $rule)
    {
        if ($this->getConfiguredRule($configuration, $rule) === '') {
            $configuration = rtrim($configuration);
            if ($configuration !== '') {
                $configuration .= "\n\n";
            }
            $commentsBefore = $rule->getCommentsBefore();
            if ($commentsBefore !== '') {
                $configuration .= $commentsBefore."\n";
            }
            $configuration .= $rule->getCode()."\n";
            $commentsAfter = $rule->getCommentsAfter();
            if ($commentsAfter !== '') {
                $configuration .= $commentsAfter."\n";
            }
        }

        return $configuration;
    }
984147
public function setRule($rule)
	{
		if(null === $rule)
		{
			$rule = Dispatch::module() . '/' . Dispatch::control() . '/' . Dispatch::action();
		}
		$this->rule = $rule;
	}
1125246
public function add($type, Rule $rule)
    {
        if (!isset($this[$type])) {
            $this[$type] = [];
        }

        if ($rule->language === false) {
            $rule->language = $this->_language;
        }

        if ($rule->validator === false) {
            $rule->validator = $this->validator;
        }

        $rule->factory->setBase($type);

        if ($rule->name !== null) {
            if (isset($this[$type][$rule->name])) {
                throw new NameConflictException("Rule with '{$rule->name}' is already defined, name has to be unique!");
            }

            $this[$type][$rule->name] = $rule;
            return;
        }

        $this[$type][] = $rule;
    }