src/Stack.php
public function replace($middleware, $with)
	{
		$this->pipeline = $this->pipeline->replace($middleware, $with);

		return $this;
	}
public function replace($middleware, $with)
	{
		$this->pipeline = $this->pipeline->replace($middleware, $with);

		return $this;
	}
Replaces middleware on the stack

@param $middleware
@param $with
@return $this