Example #1
0
 /**
  * Display the specified file.
  *
  * @param File  $file
  * @return Response
  */
 public function show(File $file)
 {
     if ($file->isProtected() && \Hash::check(app()->request->password, $file->password)) {
         return response()->download($file->path);
     }
     if (!$file->userHasAccess()) {
         return "Not authorized." . PHP_EOL;
     }
     return response()->download($file->path);
 }