Middlewares to add.

@param string|string[] $name
179811
public function middleware($name)
    {
        if (is_string($name)) {
            app()->addRouteMiddleware($name);
        } else if (is_array($name)) {
            foreach ($name as $middlewareName) {
                app()->addRouteMiddleware($middlewareName);
            }
        }
    }
726884
private function loadHelper(string $name): void
    {
        $class = static::class;

        // Somebody forgot to call `addHelperPath`
        if (!isset(static::$helpersPath[$class])) {
            throw new CommonException("Helper path not found for class `$class`");
        }

        // Try to find helper file
        foreach (static::$helpersPath[$class] as $path) {
            if ($helperPath = realpath($path . '/' . ucfirst($name) . '.php')) {
                $this->addHelper($name, $helperPath);
                return;
            }
        }

        throw new CommonException("Helper `$name` not found for class `$class`");
    }
7719
public function add(string $email, string $name = null): void
    {
        $recipient = $this->make();
        $recipient->email = $email;
        if ($name !== null) {
            $recipient->name = $name;
        }
        $this->set($recipient);
    }
138762
public function addTo(string $address, ?string $name = null): Message
    {
        $this->to[] = [
            'address' => $address,
            'name'    => $name
        ];

        return $this;
    }
781929
public function addFlag(string $name): void
    {
        if (!$this->hasFlag($name)) {
            $flagEntry = $this->entry[PoTokens::FLAG];
            if ($flagEntry === null) {
                $this->set(PoTokens::FLAG, $name);
            } elseif (is_array($flagEntry)) {
                $flagEntry[] = $name;
                $this->set(PoTokens::FLAG, implode(',', $flagEntry));
            } else {
                $this->set(PoTokens::FLAG, $flagEntry . ',' . $name);
            }
        }
    }
157062
private function add($step, $name, callable $middleware, $prepend = false)
    {
        $this->sorted = null;

        if ($prepend) {
            $this->steps[$step][] = [$middleware, $name];
        } else {
            array_unshift($this->steps[$step], [$middleware, $name]);
        }

        if ($name) {
            $this->named[$name] = $step;
        }
    }
936515
protected function addMethod($name, $parameters)
    {
        $methods = $this->methods();

        $parameters = is_array($parameters) ? $parameters : [$parameters];

        $methods[] = compact('name', 'parameters');

        $this->methods($methods);
    }
256316
public static function addMiddleware($middleware)
    {
        $kernelFile = self::read();
        if (!str_contains($kernelFile, $middleware)) {
            $kernelFile = self::insertBetween($kernelFile, 'protected $middleware = [', "]", $middleware);
            self::save($kernelFile);
        }
    }
298527
public function add(string $email, string $name = null): void
    {
        $ccRecipient = $this->make();
        $ccRecipient->email = $email;
        if ($name !== null) {
            $ccRecipient->name = $name;
        }
        $this->set($ccRecipient);
    }
140307
protected function addEndpoint($name, $url)
    {
        // Add or modify the endpoint URL
        $this->endpoints[$name] = $this->ensureSslEndpoint($url);
        $this->active_endpoint = $name;

        // Return boolean if endpoint has been added successfully
        return array_key_exists($name, $this->endpoints);
    }
376801
public function prependValidate(callable $middleware, $name = null)
    {
        $this->add(self::VALIDATE, $name, $middleware, true);
    }
427369
public function prependInit(callable $middleware, $name = null)
    {
        $this->add(self::INIT, $name, $middleware, true);
    }
501571
static public function add($tag,$name) {
        if(!isset(self::$tags[$tag])){
            self::$tags[$tag]   =   array();
        }
        if(is_array($name)){
            self::$tags[$tag]   =   array_merge(self::$tags[$tag],$name);
        }else{
            self::$tags[$tag][] =   $name;
        }
    }
144498
public function middlewareGroup($name, array $middlewareNames)
    {
        if ($this->hasMiddleware($name)) {
            $message = "Cannot add middleware group '$name'. A middleware by this name has already been registered.";
            throw new RuntimeException($message);
        }

        foreach ($middlewareNames as $middlewareName) {
            if (!$this->hasMiddleware($middlewareName)) {
                $message = "Cannot add '$middlewareName' middleware to group '$name'. It has not been registered.";
                throw new RuntimeException($message);
            }
        }

        $this->_middlewareGroups[$name] = $middlewareNames;

        return $this;
    }
277926
protected function middleware($name, $except = [])
    {
        $args = (array) $name;
        if (empty($args)) {
            return;
        }

        if (!empty($except)) {
            $route = request()->getRoute();
            $targetMethod = $route->getTargetMethod();

            foreach ($except as $method) {
                if ($targetMethod === $method) {
                    return;
                }
            }
        }

        foreach ($args as $name) {
            $this->middlewares[] = config("middlewares.$name");
        }
    }
128062
public function addOption($name, array $attributes)
    {
        /**
         * @var Route $route
         */
        foreach ($this->routes as $route) {
            $route->addOption($name, $attributes);
        }
    }
301872
public function add($name, $value)
    {
        $setting = $this->getPath($name);
        $key     = $this->getClassName($name);

        // If the current key doesn't exist in the settings array, set it up
        if (!array_key_exists($name, $this->settings)) {
            $this->settings[$key] = new $setting();
        }

        $this->settings[$key]->add($value);
    }