Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
646 B
1
Indexable
Never

    /**
     * Create an HTTP response that represents the object.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function toResponse($request)
    {
        $transaccion = ($this->repositories->transaccionRepository->findById($this->parametro))->recibo();
        $pdf = pdf::loadView('pdf.transaccion.recibo', ['recibo' => $transaccion]);
        $output = $pdf->stream();
        return new response($output, 200, [
            'Content-Type' => 'application/pdf',
            'Content-Disposition' => 'inline;filename="myfilename.pdf"'
        ]);
    }
Leave a Comment