/**
* 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));
}