Changeset 4b7e2d3 for app/Http/Controllers/Dashboard/FilesController.php
- Timestamp:
- 10/23/21 04:03:46 (3 years ago)
- Branches:
- develop, master
- Children:
- b39afb5
- Parents:
- c6b84df
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/FilesController.php
rc6b84df r4b7e2d3 26 26 "textExt" => array("txt", "doc", "docx"), 27 27 "imageExt" => array("png", "jpg", "jpeg"), 28 "fileTypes" => '.' . implode(',.', explode(',', explode(':', FileType::find('1')->mimes)[1]))28 "fileTypes" => '.' . implode(',.', explode(',', FileType::find('1')->mimes)) 29 29 ]); 30 30 } … … 35 35 $file->delete(); 36 36 Storage::disk('uploads')->delete($file->location); 37 $file->folder()->decrement('no_of_files'); 37 38 38 39 Alert::flash($file->name . " deleted successfully"); … … 59 60 $newFile->location = $location . DIRECTORY_SEPARATOR . $fileName; 60 61 $newFile->folder()->associate($folder); 62 $newFile->folder()->increment('no_of_files'); 61 63 $newFile->save(); 62 64 } … … 65 67 Alert::flash("New files added successfully"); 66 68 67 return redirect()-> route("dashboard.files.index");69 return redirect()->back(); 68 70 } 69 71 else { 70 72 Alert::flash("No files were uploaded", "error"); 71 73 72 return redirect()-> route("dashboard.files.index");74 return redirect()->back(); 73 75 } 74 76 }
Note:
See TracChangeset
for help on using the changeset viewer.