Ignore:
Timestamp:
10/23/21 04:03:46 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
b39afb5
Parents:
c6b84df
Message:

bug fixes, edited export, added fileSeeder for DB testing

File:
1 edited

Legend:

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

    rc6b84df r4b7e2d3  
    2626            "textExt" => array("txt", "doc", "docx"),
    2727            "imageExt" => array("png", "jpg", "jpeg"),
    28             "fileTypes" => '.' . implode(',.', explode(',', explode(':', FileType::find('1')->mimes)[1]))
     28            "fileTypes" => '.' . implode(',.', explode(',', FileType::find('1')->mimes))
    2929        ]);
    3030    }
     
    3535        $file->delete();
    3636        Storage::disk('uploads')->delete($file->location);
     37        $file->folder()->decrement('no_of_files');
    3738
    3839        Alert::flash($file->name . " deleted successfully");
     
    5960                $newFile->location = $location . DIRECTORY_SEPARATOR . $fileName;
    6061                $newFile->folder()->associate($folder);
     62                $newFile->folder()->increment('no_of_files');
    6163                $newFile->save();
    6264            }
     
    6567            Alert::flash("New files added successfully");
    6668
    67             return redirect()->route("dashboard.files.index");
     69            return redirect()->back();
    6870        }
    6971        else {
    7072            Alert::flash("No files were uploaded", "error");
    7173
    72             return redirect()->route("dashboard.files.index");
     74            return redirect()->back();
    7375        }
    7476    }
Note: See TracChangeset for help on using the changeset viewer.