Created
March 14, 2016 10:42
-
-
Save nivv/d4522b6d5152dcf36275 to your computer and use it in GitHub Desktop.
serve download contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function downloadFile($id) | |
{ | |
$file = File::findOrFail($id); | |
$contents = \Illuminate\Support\Facades\Storage::getDriver()->get('/'.$file->path); | |
return response()->download($contents, $file->name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment