public static function group(array $attributes, Closure $closure)
    {
        $hash = uniqid('prop_');
        //Add options
        if (isset($attributes['prefix'])) {
            static::$groupsProps['prefix'][$hash] = $attributes['prefix'];
        }
        if (isset($attributes['namespace'])) {
            static::$groupsProps['namespace'][$hash] = $attributes['namespace'];
        }
        if (isset($attributes['name'])) {
            static::$groupsProps['name'][$hash] = $attributes['name'];
        }
        if (isset($attributes['middlewares']) || isset($attributes['middleware'])) {
            static::$groupsProps['middleware'][$hash] = isset($attributes['middleware']) ?
                (array)$attributes['middleware'] :
                (array)$attributes['middlewares'];
        }
        //Run closure
        $closure();
        //Remove options
        unset(static::$groupsProps['prefix'][$hash]);
        unset(static::$groupsProps['namespace'][$hash]);
        unset(static::$groupsProps['name'][$hash]);
        unset(static::$groupsProps['middleware'][$hash]);
    }
public static function group(array $attributes, Closure $closure)
    {
        $hash = uniqid('prop_');
        //Add options
        if (isset($attributes['prefix'])) {
            static::$groupsProps['prefix'][$hash] = $attributes['prefix'];
        }
        if (isset($attributes['namespace'])) {
            static::$groupsProps['namespace'][$hash] = $attributes['namespace'];
        }
        if (isset($attributes['name'])) {
            static::$groupsProps['name'][$hash] = $attributes['name'];
        }
        if (isset($attributes['middlewares']) || isset($attributes['middleware'])) {
            static::$groupsProps['middleware'][$hash] = isset($attributes['middleware']) ?
                (array)$attributes['middleware'] :
                (array)$attributes['middlewares'];
        }
        //Run closure
        $closure();
        //Remove options
        unset(static::$groupsProps['prefix'][$hash]);
        unset(static::$groupsProps['namespace'][$hash]);
        unset(static::$groupsProps['name'][$hash]);
        unset(static::$groupsProps['middleware'][$hash]);
    }
public static function group ( array $ attributes , Closure $ closure ) { $ hash = uniqid ( 'prop_' ) ; //Add options if ( isset ( $ attributes [ 'prefix' ] ) ) { static :: $ groupsProps [ 'prefix' ] [ $ hash ] = $ attributes [ 'prefix' ] ; } if ( isset ( $ attributes [ 'namespace' ] ) ) { static :: $ groupsProps [ 'namespace' ] [ $ hash ] = $ attributes [ 'namespace' ] ; } if ( isset ( $ attributes [ 'name' ] ) ) { static :: $ groupsProps [ 'name' ] [ $ hash ] = $ attributes [ 'name' ] ; } if ( isset ( $ attributes [ 'middlewares' ] ) || isset ( $ attributes [ 'middleware' ] ) ) { static :: $ groupsProps [ 'middleware' ] [ $ hash ] = isset ( $ attributes [ 'middleware' ] ) ? ( array ) $ attributes [ 'middleware' ] : ( array ) $ attributes [ 'middlewares' ] ; } //Run closure $ closure ( ) ; //Remove options unset ( static :: $ groupsProps [ 'prefix' ] [ $ hash ] ) ; unset ( static :: $ groupsProps [ 'namespace' ] [ $ hash ] ) ; unset ( static :: $ groupsProps [ 'name' ] [ $ hash ] ) ; unset ( static :: $ groupsProps [ 'middleware' ] [ $ hash ] ) ; }
For creating a group of routes that have attributes in common
@param array $attributes specifies the common attributes. The attributes can any of prefix, namespace, name, middleware
@param Closure $closure
For creating a group of routes that have attributes in common