Dingo\Api\Routing\Router::setCurrentRoute PHP Method

setCurrentRoute() public method

Set the current route instance.
public setCurrentRoute ( Route $route ) : void
$route Route
return void
    public function setCurrentRoute(Route $route)
    {
        $this->currentRoute = $route;
    }

Usage Example

 /**
  * Refresh the request stack by resetting the authentication,
  * popping the last request from the stack, replacing the
  * input, and resetting the version and parameters.
  *
  * @return void
  */
 protected function refreshRequestStack()
 {
     if (!$this->persistAuthenticatedUser) {
         $this->auth->setUser(null);
         $this->persistAuthenticatedUser = true;
     }
     if ($route = array_pop($this->routeStack)) {
         $this->router->setCurrentRoute($route);
     }
     $this->replaceRequestInput();
     $this->version = null;
     $this->parameters = $this->files = [];
 }
All Usage Examples Of Dingo\Api\Routing\Router::setCurrentRoute