I have below function to download a pdf file
public function download($id) {
$detail = pesanmakam::findOrFail($id);
$name = date('YmdHis') . ".pdf";
$data = PDF::loadView('guest/log/pdf', compact('detail'))->setPaper('a4')->setWarnings(false)->save('myfile.pdf');
return $data->download($name);
}
above download function works fine but it's just stay on the same page. Is it possible to redirect it to another page after the download succeed?