Route Group.

@param $prefix
@param \Closure $callback
344789
public static function group($prefix, Closure $callback)
    {
        $callback->call(new static());
        foreach (static::$prefixRoutes as $key => $prefixRoute) {
            $target = $prefix.$prefixRoute['target'];
            $handler = $prefixRoute['handler'];
            $name = $prefixRoute['name'];

            unset(static::$prefixRoutes[$key]);

            call_user_func_array(
                [new static(), strtolower($prefixRoute['method'])],
                [$target, $handler, $name]
            );
        }
    }
281844
private function enterGroup($prefix, array $requirements)
    {
        $group = new RouteGroup($prefix, $requirements, $this->getParentGroup());
        $this->pushGroup($group);

        return $this;
    }
244191
public function addSubContext(string $prefix, Closure $invoker) : RoutingContext
  {
    return $this->contexts[] = new RoutingContext($prefix, $invoker, $this);
  }
941180
public function get($match, $callback, $kwargs = [])
    {
        $this->addRoute(new Route($match, 'GET', $callback, self::$group, $kwargs));
    }
338527
public function group($name, $settings = null, $callback = null)
    {
        if($this->cacheLoaded) {
            return true;
        }

        $groupName = trim($name, '/');
        $group = [];
        $group['route'] = '/' . $groupName;
        $group['before'] = $group['after'] = null;

        if (is_null($callback)) {
            $callback = $settings;
        } else {
            $group['before'][] = (!isset($settings['before']) ? null : $settings['before']);
            $group['after'][]  = (!isset($settings['after']) ? null : $settings['after']);
        }

        $groupCount = count($this->groups);
        if ($groupCount > 0) {
            $list = [];
            foreach ($this->groups as $key => $value) {
                if (is_array($value['before'])) {
                    foreach ($value['before'] as $k => $v) {
                        $list['before'][] = $v;
                    }
                    foreach ($value['after'] as $k => $v) {
                        $list['after'][] = $v;
                    }
                }
            }

            if (! is_null($group['before'])) {
                $list['before'][] = $group['before'][0];
            }

            if (! is_null($group['after'])) {
                $list['after'][] = $group['after'][0];
            }

            $group['before'] = $list['before'];
            $group['after'] = $list['after'];
        }

        $group['before'] = array_values(array_unique( (array) $group['before']));
        $group['after'] = array_values(array_unique( (array) $group['after']));

        array_push($this->groups, $group);

        if (is_object($callback)) {
            call_user_func_array($callback, [$this]);
        }

        $this->endGroup();

        return true;
    }
384900
public function group(string $prefix, \Closure $callback, array $opts = [])
    {
        $previousGroupPrefix = $this->currentGroupPrefix;
        $this->currentGroupPrefix = $previousGroupPrefix . '/' . \trim($prefix, '/');

        $previousGroupOption = $this->currentGroupOption;
        $this->currentGroupOption = $opts;

        $callback($this);

        $this->currentGroupPrefix = $previousGroupPrefix;
        $this->currentGroupOption = $previousGroupOption;
    }
1131745
public function group(Closure $closure): self
    {
        $expression = new Expression();
        $closure($expression);
        return $this->addExpression('group', $expression);
    }
16995
public static function routes($callback = null, array $options = [])
    {
        $callback = $callback ?: function ($router) {
            $router->all();
        };

        $defaultOptions = [
            'prefix' => 'oauth',
            'namespace' => '\MoeenBasra\LaravelPassportMongoDB\Http\Controllers',
        ];

        $options = array_merge($defaultOptions, $options);

        Route::group($options, function ($router) use ($callback) {
            $callback(new RouteRegistrar($router));
        });
    }
1342638
private function loadGroup($prefix, array $requirements, array $routes)
    {
        $this->builder->group($prefix, $requirements);
        $this->addRoutes($routes);
        $this->builder->endGroup();
    }
63732
public static function withLanguage(\Closure $callback, $config = [])
    {
        if (\App::runningUnitTests()) {
            $locale = \App::getLocale();
        } else {
            $locale = request()->segment(1);
        }

        if (strlen($locale) <= 2) {
            Route::group(['prefix' => $locale, 'middleware' => 'lang'], function () use ($callback) {
                $callback();
            });
        }
    }
841973
public function group($group, callable $callback, array $options = [])
    {
        $options = array_merge([
            'as' => $group,
            'namespace' => $group
        ], $options);

        if (is_array($group)) {
            foreach ($group as $k => $p) {
                $this->group($p, $callback, [
                    'as' => $options['as'][$k],
                    'namespace' => $options['namespace'][$k]
                ]);
            }
            return $this;
        }
        $this->setGroupAs($options['as']);
        $group = $this->removeDuplSlash($group . '/');
        $group = $this->namedParameters($group, true);

        $this->matched($this->prepare($group, false), false);

        $this->currentGroup = $group;
        // Add this group and sub-groups to append to route uri.
        $this->group .= $group;
        // Bind to Route Class.
//        $callback = $callback->bindTo($this);
        $callback = Closure::bind($callback, $this, get_class());
        // Call with args.
        call_user_func_array($callback, $this->bindArgs($this->pramsGroup, $this->matchedArgs));

        $this->isGroup = false;
        $this->pramsGroup = $this->pattGroup = [];
        $this->group = substr($this->group, 0, -strlen($group));
        $this->setGroupAs(substr($this->getGroupAs(), 0, -(strlen($options['as']) + 2)), true);

        return $this;
    }
485864
public function page($route, $callback) {
        if ($this->configFunction != null) {
            $function = $this->configFunction;
            $result = $function();

            if ($result === false) {
                return;
            }
        }

        $crud = $this;
        
        $this->getSlim()->get($route, function () use ($crud, $callback) {
            $content = $callback();
            
            $this->render($this->getPageLayout(), [
                "content" => $content
            ], true);
        });
    }
890394
public function group($prefix, $callback)
    {
        $group = $this->router->addGroup($this->prefix . '/' . $prefix, $callback);

        $group->onAny(function($event, $arguments){
            $this->emit($event, $arguments);
        });
    }
364717
public function group($name, $default, $attributes = [], Closure $callback = null)
    {
        $route = $this->route($name, $default);


        $attributes = array_merge($attributes, [
            'prefix' => $route->prefix(),
            'domain' => $route->domain(),
        ]);

        if (!is_null($callback)) {
            $this->app->make('router')->group($attributes, $callback);
        }

        return $attributes;
    }
149860
public function subscribe($channels, Closure $callback)
    {
        $this->client->subscribe((array) $channels, function ($redis, $channel, $message) use ($callback) {
            $callback($message, $channel);
        });
    }
25607
protected function filterJSInline(\Closure $callback)
    {
        if ($this->js) {
            $filteredJs = array();
            foreach ($this->js as $position => $jsGroup) {
                $filteredJs[$position] = array();
                foreach ($jsGroup as $key => $jsCode) {
                    if (call_user_func($callback, $jsCode, RSmartLoad::RESOURCE_TYPE_JS_INLINE)) {
                        $filteredJs[$position][$key] = $jsCode;
                    }
                }
            }
            $this->js = $filteredJs;
        }
    }
485588
public function map(Closure $callback)
    {
        return new self(array_map($callback, $this->items, array_keys($this->items)));
    }