protected function resolveWhenCollections(array $collections = [])
    {
        foreach ($collections as $index => $collection) {
            if ($this->getMatcher()->matchWhen($collection['uri'])) {

                // registering when tag
                RouteCollector::$firing['when'] = $collection['uri'];
                app()->call($collection['action'], [app('route')]);

                RouteCollector::removeWhen($index);
                break;
            }
        }

        return RouteCollector::getRoutes();
    }