Created
October 22, 2019 23:15
-
-
Save michaelaguiar/75bc8339dcc8df157373ce06177b15f2 to your computer and use it in GitHub Desktop.
Laravel validate before downloading private file
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
<?php | |
public function downloadFile(Request $request) | |
{ | |
// !VALIDATE USER HAS ACCESS | |
// Get response and clean before return | |
$response = Storage::download(FILE_PATH_HERE); | |
ob_end_clean(); | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment