Thursday, July 6, 2017

domPDF how to save a file without viewing ? LARAVEL

Asked by: dil


Below is my current code I want to store the pdf inmy files without view it . is it possible ? when user store the data for $bus object on db. I want to store below pdf on my local.

 $user = Festivals::where('id', $bus->id)->first();
        $pdf = PDF::loadView('user.view', compact('user'));
        $name = 'Ref_no' . $user->ref_no . '_' . date('m-d-Y') . '.pdf';
      return $pdf->download($name);


Source

No comments:

Post a Comment

Adbox