- Timestamp:
- 10/24/21 23:35:45 (3 years ago)
- Branches:
- develop, master
- Children:
- 495dd28
- Parents:
- 94f05dc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
r94f05dc rdf6e9ec 119 119 public function downloadAll() 120 120 { 121 $zip_file=Storage::disk('uploads')->path('Departments.zip'); 122 $zip = new \ZipArchive(); 123 $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE); 124 $path = Storage::disk('uploads')->path('Departments'); 121 try { 122 $zip_file=Storage::disk('uploads')->path('Departments.zip'); 123 $zip = new \ZipArchive(); 124 $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE); 125 $path = Storage::disk('uploads')->path('Departments'); 125 126 126 try {127 127 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); 128 128 foreach ($files as $file) { … … 149 149 public function downloadDepartment($id) 150 150 { 151 $department = Department::find($id); 151 try { 152 $department = Department::find($id); 153 $zip_file=Storage::disk('uploads')->path('Department.zip'); 154 $zip = new \ZipArchive(); 155 $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE); 156 $path = Storage::disk('uploads')->path($department->location); 152 157 153 $zip_file=Storage::disk('uploads')->path('Department.zip');154 $zip = new \ZipArchive();155 $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);156 $path = Storage::disk('uploads')->path($department->location);157 158 try {159 158 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); 160 159 foreach ($files as $file) {
Note:
See TracChangeset
for help on using the changeset viewer.