public function middleware($name)
    {
        if (is_string($name)) {
            app()->addRouteMiddleware($name);
        } else if (is_array($name)) {
            foreach ($name as $middlewareName) {
                app()->addRouteMiddleware($middlewareName);
            }
        }
    }
public function middleware($name)
    {
        if (is_string($name)) {
            app()->addRouteMiddleware($name);
        } else if (is_array($name)) {
            foreach ($name as $middlewareName) {
                app()->addRouteMiddleware($middlewareName);
            }
        }
    }
public function middleware ( $ name ) { if ( is_string ( $ name ) ) { app ( ) -> addRouteMiddleware ( $ name ) ; } else if ( is_array ( $ name ) ) { foreach ( $ name as $ middlewareName ) { app ( ) -> addRouteMiddleware ( $ middlewareName ) ; } } }
Middlewares to add.

@param string|string[] $name
Middlewares to add .