Thank you very much for your reply . The issue with this, the download is being triggered . I'm looking for something that opens the PDF in the browser . This way I don't have to force the user to download .
Ok this is different issue where it is actually browser related and you can not impose that on your users.
Try for instance dooing the same thing in safari, firefox and chrome. Chrome by default likes to open pdf's, firefox likes to download them. You can also change that default behaviour of your browser but you can not control how end user deals with it.
I have resolve this issue Here is the code :
public function DownloadNotes(PDF $p) {
$note = AcademyLessonNote::where('user_id',auth()->user()->id)->first();
if($note){
$pdf = $p->loadView('pdf.notesPdf',compact('note'))->output();
return response()->streamDownload(function () use ($pdf) {
print($pdf);
}, md5(time()).".pdf");
}
}