firstWhere('id', $applicationId); $storagePath = storage_path('app') . '/private/' . $application->document; $file = File::get($storagePath); $type = File::mimeType($storagePath); $response = response($file, 200); $response->header('Content-Type', $type); return $response; } }