fix: StudentController, AdminUserSeeder updates
This commit is contained in:
@@ -699,7 +699,12 @@ class StudentController extends Controller
|
||||
|
||||
$path = storage_path('app/private/student-import-example.xlsx');
|
||||
|
||||
abort_unless(file_exists($path), 404, 'File contoh import siswa belum tersedia.');
|
||||
if (! file_exists($path)) {
|
||||
$response = $this->downloadImportTemplate();
|
||||
$response->headers->set('Content-Disposition', 'attachment; filename="contoh-import-siswa.xlsx"');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
return response()->file($path, [
|
||||
'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
|
||||
Reference in New Issue
Block a user