away(Storage::disk($disk)->temporaryUrl($file, now()->addMinutes(5))); default: $this->authorize('view', \App\Models\Asset::class); $file = config('app.private_uploads').'/signatures/'.$filename; $filetype = Helper::checkUploadIsImage($file); $contents = file_get_contents($file, false, stream_context_create(['http' => ['ignore_errors' => true]])); if ($contents === false) { Log::warning('File '.$file.' not found'); return false; } else { return response()->make($contents)->header('Content-Type', $filetype); } } } public function getStoredEula($filename) : Response | BinaryFileResponse | RedirectResponse { $this->authorize('view', \App\Models\Asset::class); $file = config('app.private_uploads').'/eula-pdfs/'.$filename; if (Storage::exists($file)) { return response()->download($file); } return redirect()->back()->with('error', trans('general.file_does_not_exist')); } }