src/Laravel/VarDumper/VarDumperMiddleware.php
public function handle(Request $request, Closure $next)
    {
        /** @var Response $response */
        $response = $next($request);

        if ($this->stack->count() > 0) {
            $dumped = \implode(\PHP_EOL, $this->stack->all());

            $this->stack->clear();

            $response->setContent($dumped . $response->getContent());
        }

        return $response;
    }
public function handle(Request $request, Closure $next)
    {
        /** @var Response $response */
        $response = $next($request);

        if ($this->stack->count() > 0) {
            $dumped = \implode(\PHP_EOL, $this->stack->all());

            $this->stack->clear();

            $response->setContent($dumped . $response->getContent());
        }

        return $response;
    }
public function handle ( Request $ request , Closure $ next ) { /** @var Response $response */ $ response = $ next ( $ request ) ; if ( $ this -> stack -> count ( ) > 0 ) { $ dumped = \ implode ( \ PHP_EOL , $ this -> stack -> all ( ) ) ; $ this -> stack -> clear ( ) ; $ response -> setContent ( $ dumped . $ response -> getContent ( ) ) ; } return $ response ; }
Modify response after the request is handled by the application.

@param Request $request
@param Closure $next

@return mixed
Modify response after the request is handled by the application .