Changeset 6b95845 for app/Http/Controllers
- Timestamp:
- 10/19/21 18:10:01 (3 years ago)
- Branches:
- develop, master
- Children:
- c6b84df
- Parents:
- ea7b12a
- Location:
- app/Http/Controllers/Dashboard
- Files:
-
- 2 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 } -
app/Http/Controllers/Dashboard/DocumentsController.php
rea7b12a r6b95845 173 173 Storage::disk('local')->move($oldLocation, $location); 174 174 foreach($files as $file){ 175 $file->location = "test"; 175 $file->location = $location . DIRECTORY_SEPARATOR . $file->name; 176 $file->save(); 176 177 } 177 178 }
Note:
See TracChangeset
for help on using the changeset viewer.