function downloadAttachment($id) { $attachment = Attachment::find($id); if (empty($attachment)) { abort(404); } $filename = $attachment->filename; $file = public_path() . "/resources/uploads/attachments/" . $filename; $headers = array('Content-Type: application/pdf'); return Response::download($file); }