src/PDF.php
protected function responseDownload($path, $name)
    {
        $response = new Response(file_get_contents($path), 200, [
            'Content-Type' => 'application/pdf',
            'Content-Description' => 'File Transfer',
            'Content-Disposition' => 'attachment; filename="' . $name . '.pdf"',
            'Content-Transfer-Encoding' => 'binary'
        ]);

        @unlink($path);

        return $response->send();
    }
protected function responseDownload($path, $name)
    {
        $response = new Response(file_get_contents($path), 200, [
            'Content-Type' => 'application/pdf',
            'Content-Description' => 'File Transfer',
            'Content-Disposition' => 'attachment; filename="' . $name . '.pdf"',
            'Content-Transfer-Encoding' => 'binary'
        ]);

        @unlink($path);

        return $response->send();
    }
protected function responseDownload ( $ path , $ name ) { $ response = new Response ( file_get_contents ( $ path ) , 200 , [ 'Content-Type' => 'application/pdf' , 'Content-Description' => 'File Transfer' , 'Content-Disposition' => 'attachment; filename="' . $ name . '.pdf"' , 'Content-Transfer-Encoding' => 'binary' ] ) ; @ unlink ( $ path ) ; return $ response -> send ( ) ; }
Http response to download the pdf.

@param string $path
@param string $name

@return \Symfony\Component\HttpFoundation\Response
Http response to download the pdf .