Changeset 68694d4 for app/Http/Controllers/Dashboard
- Timestamp:
- 10/25/21 00:15:25 (3 years ago)
- Branches:
- develop, master
- Children:
- 2740efc
- Parents:
- bbcbb57
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
rbbcbb57 r68694d4 125 125 $path = Storage::disk('uploads')->path('Departments'); 126 126 127 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));128 127 try { 128 $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); 129 } 130 catch(\Exception $e){ 131 Alert::flash("All departments are empty", "warning"); 132 return redirect()->back(); 133 } 134 129 135 foreach ($files as $file) { 130 136 … … 141 147 $zip_new_name = Carbon::now()->format('d.m.Y - H:i') . '- Departments.zip'; 142 148 return response()->download($zip_file, $zip_new_name, $headers); 143 }144 149 145 catch(\Exception $e){146 Alert::flash("All departments are empty", "warning");147 return redirect()->back();148 }149 150 } 150 151
Note:
See TracChangeset
for help on using the changeset viewer.