Laravel\Cashier\Invoice::download PHP Method

download() public method

Create an invoice download response.
public download ( array $data ) : Response
$data array
return Symfony\Component\HttpFoundation\Response
    public function download(array $data)
    {
        $filename = $data['product'] . '_' . $this->date()->month . '_' . $this->date()->year . '.pdf';
        return new Response($this->pdf($data), 200, ['Content-Description' => 'File Transfer', 'Content-Disposition' => 'attachment; filename="' . $filename . '"', 'Content-Transfer-Encoding' => 'binary', 'Content-Type' => 'application/pdf']);
    }