Index: app/Http/Controllers/Dashboard/DepartmentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DepartmentsController.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ app/Http/Controllers/Dashboard/DepartmentsController.php	(revision 6b95845bcb5cbd47d72feb8e241175b5fc16d0e0)
@@ -8,4 +8,5 @@
 use App\Models\Department;
 use App\Models\Document;
+use App\Models\File;
 use App\Models\User;
 use Carbon\Carbon;
@@ -64,4 +65,5 @@
         $department = Department::findOrFail($id);
 
+        $documents = $department->document;
         $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $department->code;
 
@@ -75,4 +77,11 @@
                 Storage::disk('local')->move($oldLocation, $location);
                 $department->location = Storage::disk('local')->path('') . $location;
+            }
+
+            foreach ($documents as $document) {
+                foreach($document->files as $file) {
+                    $file->location = $location . DIRECTORY_SEPARATOR . $document->name . DIRECTORY_SEPARATOR . $file->name;
+                    $file->save();
+                }
             }
         }
Index: app/Http/Controllers/Dashboard/DocumentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DocumentsController.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ app/Http/Controllers/Dashboard/DocumentsController.php	(revision 6b95845bcb5cbd47d72feb8e241175b5fc16d0e0)
@@ -173,5 +173,6 @@
                 Storage::disk('local')->move($oldLocation, $location);
                 foreach($files as $file){
-                    $file->location = "test";
+                    $file->location = $location . DIRECTORY_SEPARATOR . $file->name;
+                    $file->save();
                 }
             }
Index: resources/views/dashboard/documents/edit.blade.php
===================================================================
--- resources/views/dashboard/documents/edit.blade.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ resources/views/dashboard/documents/edit.blade.php	(revision 6b95845bcb5cbd47d72feb8e241175b5fc16d0e0)
@@ -174,4 +174,5 @@
                                                                 <label class="form-label">Name</label>
                                                                 <input type="text" name="name" value="{{ explode('.', $file->name)[0] }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
+                                                                <span>.php</span>
                                                             </div>
                                                         </div>
