public function add(Request $request)
    {
        $this->stack = array_slice($this->stack, 0, $this->position + 1);
        $this->stack[] = clone $request;
        $this->position = count($this->stack) - 1;
    }
public function add(Request $request)
    {
        $this->stack = array_slice($this->stack, 0, $this->position + 1);
        $this->stack[] = clone $request;
        $this->position = count($this->stack) - 1;
    }
public function add ( Request $ request ) { $ this -> stack = array_slice ( $ this -> stack , 0 , $ this -> position + 1 ) ; $ this -> stack [ ] = clone $ request ; $ this -> position = count ( $ this -> stack ) - 1 ; }
Adds a Request to the history.

@param Request $request A Request instance
Adds a Request to the history .