/**
  * Register route middleware.
  *
  * @param Route $route
  */
 private function registerRouteMiddleware(Route $route)
 {
     if (null !== ($bag = $this->getMiddlewareBag($route))) {
         foreach ($bag->all() as $middleware => $options) {
             $rules = array();
             $params = array();
             if (is_string($options)) {
                 $middleware = $options;
             } elseif (is_array($options)) {
                 if (!isset($options['name'])) {
                     throw new InvalidArgumentException(sprintf('Missing key "name" middleware on route "%s".', $route->getPath()));
                 }
                 $middleware = $options['name'];
                 if (isset($options['rules'])) {
                     $rules = $options['rules'];
                 }
                 if (isset($options['params'])) {
                     $params = $options['params'];
                 }
             }
             $middleware = strtolower($middleware);
             $dispatcher = $this->middleware->dispatch($middleware, $params);
             $this->setMiddlewareRule($dispatcher, $rules);
         }
     }
 }
 public function __construct(MiddlewareContainer $middleware)
 {
     $middleware->dispatch('auth')->except(array('show'));
 }
 public function __construct(MiddlewareContainer $middleware)
 {
     $middleware->dispatches(array('auth'), array(), array('logout'));
 }