Ignore:
Timestamp:
10/25/21 00:15:25 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
2740efc
Parents:
bbcbb57
Message:

bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/Dashboard/DepartmentsController.php

    rbbcbb57 r68694d4  
    125125        $path = Storage::disk('uploads')->path('Departments');
    126126
    127         $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
    128127        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
    129135            foreach ($files as $file) {
    130136
     
    141147                $zip_new_name = Carbon::now()->format('d.m.Y - H:i') . '- Departments.zip';
    142148                return response()->download($zip_file, $zip_new_name, $headers);
    143                 }
    144149
    145         catch(\Exception $e){
    146            Alert::flash("All departments are empty", "warning");
    147             return redirect()->back();
    148         }
    149150    }
    150151
Note: See TracChangeset for help on using the changeset viewer.