Illuminate\Routing\Router::newRoute PHP Method

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
    protected function newRoute($methods, $uri, $action)
    {
        return (new Route($methods, $uri, $action))->setRouter($this)->setContainer($this->container);
    }

Usage Example

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);
 }
All Usage Examples Of Illuminate\Routing\Router::newRoute