- Timestamp:
- 10/19/21 18:10:01 (3 years ago)
- Branches:
- develop, master
- Children:
- c6b84df
- Parents:
- ea7b12a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
rea7b12a r6b95845 8 8 use App\Models\Department; 9 9 use App\Models\Document; 10 use App\Models\File; 10 11 use App\Models\User; 11 12 use Carbon\Carbon; … … 64 65 $department = Department::findOrFail($id); 65 66 67 $documents = $department->document; 66 68 $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $department->code; 67 69 … … 75 77 Storage::disk('local')->move($oldLocation, $location); 76 78 $department->location = Storage::disk('local')->path('') . $location; 79 } 80 81 foreach ($documents as $document) { 82 foreach($document->files as $file) { 83 $file->location = $location . DIRECTORY_SEPARATOR . $document->name . DIRECTORY_SEPARATOR . $file->name; 84 $file->save(); 85 } 77 86 } 78 87 }
Note:
See TracChangeset
for help on using the changeset viewer.