src/Routing/Router.php
/**
	 * Registers a middleware. If the second parameter is provided a closure, it creates a middleware group which applies
	 * to all routes registered within that closure. Otherwise, the middleware applies to all routes defined thereafter,
	 * in the current scope.
	 *
	 * @param string|string[] $middleware
	 * @param Closure|null $callback
	 * @return RouteGroup|void
	 */
Registers a middleware. If the second parameter is provided a closure, it creates a middleware group which applies
to all routes registered within that closure. Otherwise, the middleware applies to all routes defined thereafter,
in the current scope.

@param string|string[] $middleware
@param Closure|null $callback
@return RouteGroup|void
Registers a middleware . If the second parameter is provided a closure it creates a middleware group which applies to all routes registered within that closure . Otherwise the middleware applies to all routes defined thereafter in the current scope . @param string|string [] $middleware @param Closure|null $callback @return RouteGroup|void
public function createMiddleware($middleware, Closure $callback = null) {
		if (!is_array($middleware)) {
			$middleware = array($middleware);
		}
		if (!is_null($callback)) {
			return $this->createMiddlewareGroup($middleware, $callback);
		}
		$this->currentGroup->addMiddleware($middleware);
	}
public function createMiddleware ( $ middleware , Closure $ callback = null ) { if ( ! is_array ( $ middleware ) ) { $ middleware = array ( $ middleware ) ; } if ( ! is_null ( $ callback ) ) { return $ this -> createMiddlewareGroup ( $ middleware , $ callback ) ; } $ this -> currentGroup -> addMiddleware ( $ middleware ) ; }
Registers a middleware.
Registers a middleware .