自分用のメモとして残します。
文字列をダウンロードファイルとしてレスポンスを返す方法をメモ。
→つまりレスポンス用にわざわざファイルを保存しない。
■やり方
\Responseクラスでレスポンス用のオブジェクトを明示的に作成する。
$content = 'hoge,hoge,hoge';
$headers = [
'Content-type' => 'text/plain; charset=utf-8',
'Content-Disposition' => 'attachment; filename="download.txt"',
];
$response = \Response::make($content, 200, $headers);
return $response;