Illuminate\Routing\Router::addRoute PHP Method

addRoute() protected method

Add a route to the underlying route collection.
protected addRoute ( array | string $methods, string $uri, Closure | array | string | null $action ) : Illuminate\Routing\Route
$methods array | string
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route
    protected function addRoute($methods, $uri, $action)
    {
        return $this->routes->add($this->createRoute($methods, $uri, $action));
    }

Usage Example

Example #1
0
 /**
  * Add a route to the underlying route collection.
  *
  * @param  array|string          $methods
  * @param  string                $uri
  * @param  \Closure|array|string $action
  *
  * @return \Illuminate\Routing\Route
  */
 protected function addRoute($methods, $uri, $action)
 {
     if (in_array('restful', array_flatten($this->groupStack))) {
         parent::addRoute($methods, $uri . $this->formatSuffix, $action);
     }
     return $this->routes->add($this->createRoute($methods, $uri, $action));
 }
All Usage Examples Of Illuminate\Routing\Router::addRoute