Other Response Types: File Downloads

Return response()->download($pathToFile);

return response()->download($pathToFile, $name, $headers);

return response()->download($pathToFile)->deleteFileAfterSend(true);

Streamed Downloads

Return response()->streamDownload(function () {
    echo GitHub::api('repo')
                ->contents()
                ->readme('laravel', 'laravel')['contents'];
}, 'laravel-readme.md');

Other Response Types: File Downloads — Structure map

Clickable & Draggable!

Other Response Types: File Downloads — Related pages: