newRoute() protected method

Create a new Route object.
protected newRoute ( array | string $methods, string $uri, mixed $action ) : Illuminate\Routing\Route
$methods array | string
$uri string
$action mixed
return Illuminate\Routing\Route
Example #1
0
 /**
  * @docInherit
  */
 protected function newRoute($methods, $uri, $action)
 {
     if (count($this->localeStack) === 0) {
         return parent::newRoute($methods, $uri, $action);
     }
     $locale = end($this->localeStack);
     return new Route($methods, $uri, $action, $locale);
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 protected function newRoute($methods, $uri, $action)
 {
     if ($this->routingToApi()) {
         return new Route($methods, $uri, $action);
     }
     return parent::newRoute($methods, $uri, $action);
 }