Changeset 8fdb18e for app


Ignore:
Timestamp:
10/31/21 22:29:22 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
master
Children:
1451c6f
Parents:
4521f25
Message:

bug fixes

Location:
app/Http/Controllers/Dashboard
Files:
3 edited

Legend:

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

    r4521f25 r8fdb18e  
    4040        $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code;
    4141
    42         if(!Storage::disk('uploads')->has($location)){
    43             Storage::disk('uploads')->makeDirectory($location);
     42        if(!Storage::disk('local')->has($location)){
     43            Storage::disk('local')->makeDirectory($location);
    4444
    4545        }
     
    7777        {
    7878            $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code;
    79             if(!Storage::disk('uploads')->has($location)){
    80                 Storage::disk('uploads')->move($oldLocation, $location);
     79            if(!Storage::disk('local')->has($location)){
     80                Storage::disk('local')->move($oldLocation, $location);
    8181                $department->location = $location;
    8282            }
     
    136136
    137137            if($flag) {
    138             $zip_file = Storage::disk('uploads')->path('Departments.zip');
     138            $zip_file = Storage::disk('local')->path('Departments.zip');
    139139            $zip = new \ZipArchive();
    140140            $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
    141141
    142             $path = Storage::disk('uploads')->path('Departments');
     142            $path = Storage::disk('local')->path('Departments');
    143143
    144144            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
     
    180180
    181181            if($flag) {
    182             $zip_file=Storage::disk('uploads')->path('Department.zip');
     182            $zip_file=Storage::disk('local')->path('Department.zip');
    183183            $zip = new \ZipArchive();
    184184            $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
    185             $path = Storage::disk('uploads')->path($department->location);
     185            $path = Storage::disk('local')->path($department->location);
    186186
    187187            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
  • app/Http/Controllers/Dashboard/FilesController.php

    r4521f25 r8fdb18e  
    3434        $file = File::find($id);
    3535        $file->delete();
    36         Storage::disk('uploads')->delete($file->location);
     36        Storage::disk('local')->delete($file->location);
    3737        $file->folder()->decrement('no_of_files');
    3838
  • app/Http/Controllers/Dashboard/FoldersController.php

    r4521f25 r8fdb18e  
    146146        $location = $folder->department->location . DIRECTORY_SEPARATOR . $request->name;
    147147
    148         if (!Storage::disk('uploads')->has($location)) {
    149             Storage::disk('uploads')->makeDirectory($location);
     148        if (!Storage::disk('local')->has($location)) {
     149            Storage::disk('local')->makeDirectory($location);
    150150        }
    151151
     
    254254            $folder->delete();
    255255            $location = $folder->department->location . DIRECTORY_SEPARATOR . $folder->name;
    256             Storage::disk('uploads')->deleteDirectory($location);
     256            Storage::disk('local')->deleteDirectory($location);
    257257            $folder->department()->decrement('no_of_folders');
    258258            Alert::flash($folder->name . " deleted successfully");
     
    269269
    270270            if($folder->no_of_files > 0) {
    271                 $zip_file = Storage::disk('uploads')->path('Folder.zip');
     271                $zip_file = Storage::disk('local')->path('Folder.zip');
    272272                $zip = new \ZipArchive();
    273273                $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
    274274
    275                 $path = Storage::disk('uploads')->path($folder->department->location . DIRECTORY_SEPARATOR . $folder->name);
     275                $path = Storage::disk('local')->path($folder->department->location . DIRECTORY_SEPARATOR . $folder->name);
    276276
    277277                $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
Note: See TracChangeset for help on using the changeset viewer.