json(['message' => 'Still working.....'], 409); } Cache::forget($hash); $headers = [ 'Content-Disposition' => 'attachment', 'Content-Type' => 'text/csv', ]; return response()->streamDownload(function () use ($report) { echo $report; }, $this->filename, $headers); } }