DWQA Questionshow-to-download-file-in-laravel?
asked 6 years ago

Solutions :
 
Example : 
create link that will redirect to following method. and your file will be download.
public function downloadFile() {

        $file= storage_path(). “/logs/log.log”;
    $headers = array(
              ‘Content-Type: plain/text’,
            );
 
    return Response::download($file, ‘log.log’, $headers); 
}

 
Thankss