DA
$name = time().'.pdf';
ob_clean();
$headers = ['Content-Type: application/pdf'];
// $headers = array(
// 'Content-Type' => 'application/pdf',
// );
$headers = [
'Content-Type' => 'application/x-rar-compressed',
];
return response()->download($pathToFile);