fix: change path download template and add template pariwisata

This commit is contained in:
2025-02-20 10:36:56 +07:00
parent f10bc153b4
commit dcd93d66e2
6 changed files with 20 additions and 4 deletions

View File

@@ -127,4 +127,18 @@ class TourismController extends Controller
return response()->noContent();
}
public function downloadExcelTourism()
{
$filePath = public_path('templates/template_pariwisata.xlsx');
info(sprintf("File Path: %s | Exists: %s", $filePath, file_exists($filePath) ? 'Yes' : 'No'));
// Cek apakah file ada
if (!file_exists($filePath)) {
return response()-> json(['message' => 'File tidak ditemukan!'], Response::HTTP_NOT_FOUND);
}
// Return file to download
return response()->download($filePath);
}
}