Share PDF on mail in laravel

PDF canbe shared in attachment at the time of storing data in database
PDF canbe shared in attachment at the time of storing data in database
Controller :
use PDF;
$rs = Model::create([
'user_id' => Auth::user()->id,
'name' => $request->name,
'email' => $request->email,
'phone' => $request->phone,
'subject' => $request->subject,
'message' => $request->message,
]);
$pdf = PDF::loadView('pdf.invoice', ['title' => 'Title', 'rs' => $rs]);
$path = $pdf->save(storage_path('app/pdf/'.$rs->id . '.pdf'));
$attachment = asset('storage/app/sofpdf/'.$rs->sof_id . '.pdf');
Note: This attachment then can be shared shared on file as attachment
View : invoice.blade.php
{{ $rs->name }}
0 Comment's
Add Comment
Register to Reply
Login
Register