Hi everybody
I save a pdf to public path and when i want to download it or stream it, It generates other pdfs and fails to download the one I call
Any idea ?
Hello, maybe you have a route pointing to a similar path. It is the only cause that comes to mind right now. Make sure the folder you are saving your file dont match some route like Route::get('pdf',...);
Thanks @swalker2 for the reply. I revised the route file but there is no problem from this kind !! .here is my code to make it clear to understand what's happening
$pdf = PDF::loadView('pdfs.result', [
'user'=>$user
])->save(public_path('/pdfs/'.'_'.$user->id.'.pdf' ));
return $pdf->stream();//also the download method do the same thing.
return a downloadable link looks like this ''http://localhost:8000/users"
and when i download it it generate the same pdf with incremented ids in their file names. something like 144.pdf ,145.pdf and 146.pdf