How to return a downloadable file in Laravel
Categorized as Laravel
If you need to return a downloadable file in Laravel, just do it with this easy technique – enable the download method on the response object. For example:
public function show()
{
$file = public_path('misc/file.pdf');
return response()->download($file);
}