Пример #1
0
 public function it_can_add_route_groups()
 {
     $group = new RouteGroup([Route::get('/yolo', 'Foo::bar'), Route::get('/fomo', 'Foo::bar')], 'tomorrow');
     $this->beConstructedWith([], 'today');
     $this->addGroup($group);
     $this->updateRoutes();
     $routes = $this->getRoutes();
     $routes->shouldBeArray();
     $routes[0]->getUrl()->shouldEqual('today/tomorrow/yolo');
 }
Пример #2
0
 public function outputRoute($name, $parameters = [])
 {
     if (isset($this->namedRoutes[$name])) {
         $route = $this->namedRoutes[$name];
     } elseif ($this->inferRoute($name) !== false) {
         $route = $this->inferRoute($name);
     } else {
         throw new BadRouteException('Route Not Found or Does Not have Name');
     }
     return Route::get($route, null, $this->base_url, $parameters);
 }