for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Http\Controllers;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class DownloadsController extends Controller
{
/**
* Download a file.
*
* @param string $fileName
* @return BinaryFileResponse
*/
public function download($fileName)
$filePath = public_path('files/'.$fileName);
return response()->download($filePath);
}