middleware; } /** * Get the route pattern * * @return string */ public function getPattern() { return $this->pattern; } /** * Set container for use with resolveCallable * * @param ContainerInterface $container * * @return self */ public function setContainer(ContainerInterface $container) { $this->container = $container; return $this; } /** * Prepend middleware to the middleware collection * * @param mixed $callable The callback routine * * @return static */ public function add($callable) { $callable = $this->resolveCallable($callable); if ($callable instanceof Closure) { $callable = $callable->bindTo($this->container); } $this->middleware[] = $callable; return $this; } }