Index: app/Http/Controllers/Dashboard/DepartmentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DepartmentsController.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ app/Http/Controllers/Dashboard/DepartmentsController.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -14,4 +14,5 @@
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Storage;
+use function Illuminate\Events\queueable;
 
 class DepartmentsController extends Controller
@@ -36,12 +37,12 @@
         $department->code = $request->code;
 
-        $len = Storage::disk('local')->path('');
+        $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code;
 
-        if(!Storage::disk('local')->has('Departments/' . $request->code)){
-            Storage::disk('local')->makeDirectory('Departments/' . $request->code);
+        if(!Storage::disk('local')->has($location)){
+            Storage::disk('local')->makeDirectory($location);
+
         }
-
+        $department->location = Storage::disk('local')->path('') . $location;
         $department->user_id = auth()->id();
-        $department->location =  Storage::disk('local')->path('') . 'Departments/' . $request->code;
 
         $department->save();
@@ -63,17 +64,15 @@
         $department = Department::findOrFail($id);
 
-        $oldDepartmentCode = $department->code;
+        $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $department->code;
 
         $department->name = $request->name;
         $department->code = $request->code;
 
-        $department->location =  Storage::disk('local')->path('') . 'Departments/' . $request->code;
-
-        $files = Storage::allFiles($oldDepartmentCode);
-
         if($department->isDirty('code'))
         {
-            if(!Storage::disk('local')->has('Departments/' . $request->code)){
-                Storage::disk('local')->move('Departments/' . $oldDepartmentCode, 'Departments/' . $department->code);
+            $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code;
+            if(!Storage::disk('local')->has($location)){
+                Storage::disk('local')->move($oldLocation, $location);
+                $department->location = Storage::disk('local')->path('') . $location;
             }
         }
Index: app/Http/Controllers/Dashboard/DocumentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DocumentsController.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ app/Http/Controllers/Dashboard/DocumentsController.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -26,35 +26,31 @@
         $result = $result->flatten();
 
+        $deptName = "";
+        $deptCode = "";
 
         if ($request->query('id')) {
-
-            $documentsInDeptSort = Document::with('department')->when($request->has('id'), function($query) use ($request) {
+            $deptName = Department::find($request->query('id'))->getOriginal('name');
+            $deptCode = Department::find($request->query('id'))->getOriginal('code');
+            $documentsInDeptSort = Document::with('department')->when($request->has('id'), function ($query) use ($request) {
                 $query->where('department_id', $request->query('id'));
             });
 
-            if($request->query('sort') == 'newest') {
-                $documents = $documentsInDeptSort->orderBy('created_at', 'desc')->paginate(20);
-            }
-            else if($request->query('sort') == 'name') {
-                $documents = $documentsInDeptSort->orderBy('name', 'asc')->paginate(20);
-            }
-            else{
-                $documents = Document::where('department_id', $request->query('id'))->paginate(20);
-            }
-        }
-        else {
-            if($request->query('sort') == 'newest') {
-                $documents = Document::orderBy('created_at', 'desc')->paginate(20);
-            }
-            else if($request->query('sort') == 'name') {
-                $documents = Document::orderBy('name', 'asc')->paginate(20);
-            }
-            else if($request->query('sort') == 'important'){
-                $documents = Document::where('is_important', true)->paginate(20);
-            }
-            else if($request->query('sort') == 'recent') {
-               $documents = Document::orderBy('created_at', 'desc')->paginate(20);
-            }
-            else if($request->query('search')){
+            if ($request->query('sort') == 'newest') {
+                $documents = $documentsInDeptSort->orderBy('created_at', 'desc')->paginate(16);
+            } else if ($request->query('sort') == 'name') {
+                $documents = $documentsInDeptSort->orderBy('name', 'asc')->paginate(16);
+            } else {
+                $documents = Document::where('department_id', $request->query('id'))->paginate(16);
+            }
+        } else {
+            if ($request->query('sort') == 'newest') {
+                $documents = Document::orderBy('created_at', 'desc')->paginate(16);
+            } else if ($request->query('sort') == 'name') {
+                $documents = Document::orderBy('name', 'asc')->paginate(16);
+            } else if ($request->query('sort') == 'important') {
+                $documents = Document::where('is_important', true)->paginate(16);
+            } else if ($request->query('sort') == 'recent') {
+                $documents = Document::orderBy('created_at', 'desc')->paginate(16);
+            } else if ($request->query('search')) {
                 $result = collect();
 
@@ -64,7 +60,5 @@
                 $result = $result->flatten();
                 $documents = $result;
-            }
-            else
-            {
+            } else {
                 $documents = Document::paginate(20);
             }
@@ -76,5 +70,5 @@
         $diskTotalSize = $diskTotal / 1073741824;
 
-        $diskFree  = disk_free_space('/');
+        $diskFree = disk_free_space('/');
         $used = $diskTotal - $diskFree;
 
@@ -93,5 +87,7 @@
             "diskTotalSize" => $diskTotalSize,
             "diskUse" => $diskUse,
-            "diskUsedSize" => $diskUsedSize
+            "diskUsedSize" => $diskUsedSize,
+            "deptName" => $deptName,
+            "deptCode" => $deptCode,
 
         ]);
@@ -106,5 +102,5 @@
     }
 
-    public function store(DocumentRequest $request, UploadService $uploadService)
+    public function store(DocumentRequest $request)
     {
         $document = new Document();
@@ -119,20 +115,20 @@
         $document->description = $request->description;
 
-        if (!Storage::disk('local')->has($document->department()->pluck('location')->join("") . '/' . $request->arch_id)) {
-            Storage::disk('local')->makeDirectory($document->department()->pluck('location')->join("") . '/' . $request->arch_id);
-        }
-
-        $documentFile = $uploadService->upload(File::class, [
-            "file_item" => $request->file_item,
-        ], "link", true);
+        $location = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $request->name;
+
+        if (!Storage::disk('local')->has($location)) {
+            Storage::disk('local')->makeDirectory($location);
+        }
+
+        foreach ($request->file_item as $file) {
+            $file->storeAs($location . DIRECTORY_SEPARATOR, $file->getClientOriginalName());
+            $newFile = new File();
+            $newFile->link = $location . DIRECTORY_SEPARATOR . $file->getClientOriginalName();
+            $newFile->document()->associate($document);
+            $newFile->save();
+        }
 
         $document->save();
 
-        foreach ($documentFile as $df) {
-            $file = File::find($df);
-            $file->document()->associate($document);
-            $file->save();
-        }
-
         Alert::flash("New document created successfully");
 
@@ -142,8 +138,4 @@
     public function editShow($id)
     {
-//        if (!auth()->user()->hasPermission("edit_all_documents")) {
-//            return redirect()->route("dashboard.documents.index");
-//        }
-
         return view("dashboard.documents.edit")->with([
             "document" => Document::findOrFail($id),
@@ -164,4 +156,34 @@
         $document->description = $request->description;
 
+        $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $document->name;
+        $location = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $request->name;
+
+        if ($document->isDirty('name')) {
+            if (!Storage::disk('local')->has($location)) {
+                Storage::disk('local')->move($oldLocation, $location);
+            }
+        }
+
+        $hasFileError = false;
+        if ($request->has('file_item')) {
+            foreach ($request->file_item as $file) {
+                $fileName = $file->getClientOriginalName();
+                if(Storage::disk('local')->has($location . DIRECTORY_SEPARATOR . $fileName)) {
+                    $hasFileError = true;
+                    break;
+                }
+                $file->storeAs($location . DIRECTORY_SEPARATOR, $fileName);
+                $newFile = new File();
+                $newFile->link = $location . DIRECTORY_SEPARATOR . $fileName;
+                $newFile->document()->associate($document);
+                $newFile->save();
+            }
+        }
+
+        if($hasFileError) {
+            Alert::flash('Document with the same name exists', 'error');
+            return redirect()->route("dashboard.documents.edit", ['id' => $document->id]);
+        }
+
         $document->save();
 
@@ -177,6 +199,6 @@
         $document->save();
 
-        if($document->is_important==true)
-        Alert::flash("Document marked as important successfully");
+        if ($document->is_important == true)
+            Alert::flash("Document marked as important successfully");
         else
             Alert::flash("Document marked as not important successfully");
@@ -208,5 +230,5 @@
     {
         $document = Document::find($id);
-        if (auth()->user()->hasPermission("delete_all_posts")) {
+        if (auth()->user()->hasPermission("delete_all_documents")) {
             $document->delete();
             Alert::flash($document->name . " deleted successfully");
Index: app/Http/Requests/Dashboard/DocumentRequest.php
===================================================================
--- app/Http/Requests/Dashboard/DocumentRequest.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ app/Http/Requests/Dashboard/DocumentRequest.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -36,7 +36,13 @@
             "arch_id" => [
                 "required",
-                function($attribute, $value, $fail) {
+                function ($attribute, $value, $fail) {
                     $arch_id = $this->request->get('arch_id');
                     $deptId = explode('/', $arch_id)[0];
+                    $archNum = explode('/', $arch_id)[1];
+
+                    if (empty($archNum)) {
+                        $fail("Please enter documents Archive ID");
+                    }
+
                     if ($deptId !== Department::find($this->request->get('department'))->code) {
                         $fail("Document Archive ID field format is invalid");
Index: app/Services/UploadService.php
===================================================================
--- app/Services/UploadService.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ app/Services/UploadService.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -11,4 +11,5 @@
     public function upload($object, $names, $fieldName = null, $isMultiple = false)
     {
+        dd($object);
         $objIds = [];
 
Index: composer.lock
===================================================================
--- composer.lock	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ composer.lock	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -581,14 +581,14 @@
         {
             "name": "graham-campbell/result-type",
-            "version": "v1.0.2",
+            "version": "v1.0.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/GrahamCampbell/Result-Type.git",
-                "reference": "84afea85c6841deeea872f36249a206e878a5de0"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/84afea85c6841deeea872f36249a206e878a5de0",
-                "reference": "84afea85c6841deeea872f36249a206e878a5de0",
+                "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/296c015dc30ec4322168c5ad3ee5cc11dae827ac",
+                "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac",
                 "shasum": ""
             },
@@ -626,5 +626,5 @@
             "support": {
                 "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
-                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.2"
+                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.3"
             },
             "funding": [
@@ -638,26 +638,27 @@
                 }
             ],
-            "time": "2021-08-28T21:34:50+00:00"
+            "time": "2021-10-17T19:48:54+00:00"
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "7.3.0",
+            "version": "7.4.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "7008573787b430c1c1f650e3722d9bba59967628"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628",
-                "reference": "7008573787b430c1c1f650e3722d9bba59967628",
+                "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94",
+                "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94",
                 "shasum": ""
             },
             "require": {
                 "ext-json": "*",
-                "guzzlehttp/promises": "^1.4",
-                "guzzlehttp/psr7": "^1.7 || ^2.0",
+                "guzzlehttp/promises": "^1.5",
+                "guzzlehttp/psr7": "^1.8.3 || ^2.1",
                 "php": "^7.2.5 || ^8.0",
-                "psr/http-client": "^1.0"
+                "psr/http-client": "^1.0",
+                "symfony/deprecation-contracts": "^2.2"
             },
             "provide": {
@@ -669,5 +670,5 @@
                 "php-http/client-integration-tests": "^3.0",
                 "phpunit/phpunit": "^8.5.5 || ^9.3.5",
-                "psr/log": "^1.1"
+                "psr/log": "^1.1 || ^2.0 || ^3.0"
             },
             "suggest": {
@@ -679,5 +680,5 @@
             "extra": {
                 "branch-alias": {
-                    "dev-master": "7.3-dev"
+                    "dev-master": "7.4-dev"
                 }
             },
@@ -696,4 +697,9 @@
             "authors": [
                 {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
                     "name": "Michael Dowling",
                     "email": "mtdowling@gmail.com",
@@ -701,11 +707,30 @@
                 },
                 {
+                    "name": "Jeremy Lindblom",
+                    "email": "jeremeamia@gmail.com",
+                    "homepage": "https://github.com/jeremeamia"
+                },
+                {
+                    "name": "George Mponos",
+                    "email": "gmponos@gmail.com",
+                    "homepage": "https://github.com/gmponos"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
                     "name": "Márk Sági-Kazár",
                     "email": "mark.sagikazar@gmail.com",
-                    "homepage": "https://sagikazarmark.hu"
+                    "homepage": "https://github.com/sagikazarmark"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
+                    "homepage": "https://github.com/Tobion"
                 }
             ],
             "description": "Guzzle is a PHP HTTP client library",
-            "homepage": "http://guzzlephp.org/",
             "keywords": [
                 "client",
@@ -721,5 +746,5 @@
             "support": {
                 "issues": "https://github.com/guzzle/guzzle/issues",
-                "source": "https://github.com/guzzle/guzzle/tree/7.3.0"
+                "source": "https://github.com/guzzle/guzzle/tree/7.4.0"
             },
             "funding": [
@@ -733,26 +758,22 @@
                 },
                 {
-                    "url": "https://github.com/alexeyshockov",
-                    "type": "github"
-                },
-                {
-                    "url": "https://github.com/gmponos",
-                    "type": "github"
-                }
-            ],
-            "time": "2021-03-23T11:33:13+00:00"
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-10-18T09:52:00+00:00"
         },
         {
             "name": "guzzlehttp/promises",
-            "version": "1.4.1",
+            "version": "1.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/promises.git",
-                "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
-                "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
+                "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/136a635e2b4a49b9d79e9c8fee267ffb257fdba0",
+                "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0",
                 "shasum": ""
             },
@@ -766,5 +787,5 @@
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.4-dev"
+                    "dev-master": "1.5-dev"
                 }
             },
@@ -783,7 +804,22 @@
             "authors": [
                 {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
                     "name": "Michael Dowling",
                     "email": "mtdowling@gmail.com",
                     "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
+                    "homepage": "https://github.com/Tobion"
                 }
             ],
@@ -794,20 +830,34 @@
             "support": {
                 "issues": "https://github.com/guzzle/promises/issues",
-                "source": "https://github.com/guzzle/promises/tree/1.4.1"
-            },
-            "time": "2021-03-07T09:25:29+00:00"
+                "source": "https://github.com/guzzle/promises/tree/1.5.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-10-07T13:05:22+00:00"
         },
         {
             "name": "guzzlehttp/psr7",
-            "version": "2.0.0",
+            "version": "2.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/psr7.git",
-                "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/psr7/zipball/1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",
-                "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",
+                "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
+                "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
                 "shasum": ""
             },
@@ -833,5 +883,5 @@
             "extra": {
                 "branch-alias": {
-                    "dev-master": "2.0-dev"
+                    "dev-master": "2.1-dev"
                 }
             },
@@ -846,4 +896,9 @@
             ],
             "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
                 {
                     "name": "Michael Dowling",
@@ -852,5 +907,21 @@
                 },
                 {
+                    "name": "George Mponos",
+                    "email": "gmponos@gmail.com",
+                    "homepage": "https://github.com/gmponos"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://github.com/sagikazarmark"
+                },
+                {
                     "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
                     "homepage": "https://github.com/Tobion"
                 },
@@ -874,20 +945,34 @@
             "support": {
                 "issues": "https://github.com/guzzle/psr7/issues",
-                "source": "https://github.com/guzzle/psr7/tree/2.0.0"
-            },
-            "time": "2021-06-30T20:03:07+00:00"
+                "source": "https://github.com/guzzle/psr7/tree/2.1.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-10-06T17:43:30+00:00"
         },
         {
             "name": "laravel/framework",
-            "version": "v8.62.0",
+            "version": "v8.64.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/framework.git",
-                "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/laravel/framework/zipball/60a7e00488167ce2babf3a2aeb3677e48aaf39be",
-                "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be",
+                "reference": "3337c029e1bb31d9712d27437cc27010ba302c9e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel/framework/zipball/3337c029e1bb31d9712d27437cc27010ba302c9e",
+                "reference": "3337c029e1bb31d9712d27437cc27010ba302c9e",
                 "shasum": ""
             },
@@ -1047,18 +1132,18 @@
                 "source": "https://github.com/laravel/framework"
             },
-            "time": "2021-09-28T13:30:25+00:00"
+            "time": "2021-10-12T13:43:13+00:00"
         },
         {
             "name": "laravel/sanctum",
-            "version": "v2.11.2",
+            "version": "v2.11.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/sanctum.git",
-                "reference": "b21e65cbe13896946986cb0868180cd69e1bd5d3"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/laravel/sanctum/zipball/b21e65cbe13896946986cb0868180cd69e1bd5d3",
-                "reference": "b21e65cbe13896946986cb0868180cd69e1bd5d3",
+                "reference": "2cc0c0f79eb92578f606f6130fafd31b18229db1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel/sanctum/zipball/2cc0c0f79eb92578f606f6130fafd31b18229db1",
+                "reference": "2cc0c0f79eb92578f606f6130fafd31b18229db1",
                 "shasum": ""
             },
@@ -1111,18 +1196,18 @@
                 "source": "https://github.com/laravel/sanctum"
             },
-            "time": "2021-06-15T15:56:21+00:00"
+            "time": "2021-10-13T13:38:15+00:00"
         },
         {
             "name": "laravel/serializable-closure",
-            "version": "v1.0.2",
+            "version": "v1.0.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/serializable-closure.git",
-                "reference": "679e24d36ff8b9be0e36f5222244ec8602e18867"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/679e24d36ff8b9be0e36f5222244ec8602e18867",
-                "reference": "679e24d36ff8b9be0e36f5222244ec8602e18867",
+                "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/6cfc678735f22ccedad761b8cae2bab14c3d8e5b",
+                "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b",
                 "shasum": ""
             },
@@ -1170,5 +1255,5 @@
                 "source": "https://github.com/laravel/serializable-closure"
             },
-            "time": "2021-09-29T13:25:52+00:00"
+            "time": "2021-10-07T14:00:57+00:00"
         },
         {
@@ -1585,14 +1670,14 @@
         {
             "name": "monolog/monolog",
-            "version": "2.3.4",
+            "version": "2.3.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Seldaek/monolog.git",
-                "reference": "437e7a1c50044b92773b361af77620efb76fff59"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/437e7a1c50044b92773b361af77620efb76fff59",
-                "reference": "437e7a1c50044b92773b361af77620efb76fff59",
+                "reference": "fd4380d6fc37626e2f799f29d91195040137eba9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9",
+                "reference": "fd4380d6fc37626e2f799f29d91195040137eba9",
                 "shasum": ""
             },
@@ -1610,5 +1695,5 @@
                 "graylog2/gelf-php": "^1.4.2",
                 "mongodb/mongodb": "^1.8",
-                "php-amqplib/php-amqplib": "~2.4",
+                "php-amqplib/php-amqplib": "~2.4 || ^3",
                 "php-console/php-console": "^3.1.3",
                 "phpspec/prophecy": "^1.6.1",
@@ -1668,5 +1753,5 @@
             "support": {
                 "issues": "https://github.com/Seldaek/monolog/issues",
-                "source": "https://github.com/Seldaek/monolog/tree/2.3.4"
+                "source": "https://github.com/Seldaek/monolog/tree/2.3.5"
             },
             "funding": [
@@ -1680,5 +1765,5 @@
                 }
             ],
-            "time": "2021-09-15T11:27:21+00:00"
+            "time": "2021-10-01T21:08:31+00:00"
         },
         {
@@ -1778,19 +1863,19 @@
         {
             "name": "nette/schema",
-            "version": "v1.2.1",
+            "version": "v1.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nette/schema.git",
-                "reference": "f5ed39fc96358f922cedfd1e516f0dadf5d2be0d"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/nette/schema/zipball/f5ed39fc96358f922cedfd1e516f0dadf5d2be0d",
-                "reference": "f5ed39fc96358f922cedfd1e516f0dadf5d2be0d",
-                "shasum": ""
-            },
-            "require": {
-                "nette/utils": "^3.1.4 || ^4.0",
-                "php": ">=7.1 <8.1"
+                "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df",
+                "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df",
+                "shasum": ""
+            },
+            "require": {
+                "nette/utils": "^2.5.7 || ^3.1.5 ||  ^4.0",
+                "php": ">=7.1 <8.2"
             },
             "require-dev": {
@@ -1834,7 +1919,7 @@
             "support": {
                 "issues": "https://github.com/nette/schema/issues",
-                "source": "https://github.com/nette/schema/tree/v1.2.1"
-            },
-            "time": "2021-03-04T17:51:11+00:00"
+                "source": "https://github.com/nette/schema/tree/v1.2.2"
+            },
+            "time": "2021-10-15T11:40:02+00:00"
         },
         {
@@ -2474,14 +2559,14 @@
         {
             "name": "psy/psysh",
-            "version": "v0.10.8",
+            "version": "v0.10.9",
             "source": {
                 "type": "git",
                 "url": "https://github.com/bobthecow/psysh.git",
-                "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3",
-                "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3",
+                "reference": "01281336c4ae557fe4a994544f30d3a1bc204375"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/bobthecow/psysh/zipball/01281336c4ae557fe4a994544f30d3a1bc204375",
+                "reference": "01281336c4ae557fe4a994544f30d3a1bc204375",
                 "shasum": ""
             },
@@ -2543,7 +2628,7 @@
             "support": {
                 "issues": "https://github.com/bobthecow/psysh/issues",
-                "source": "https://github.com/bobthecow/psysh/tree/v0.10.8"
-            },
-            "time": "2021-04-10T16:23:39+00:00"
+                "source": "https://github.com/bobthecow/psysh/tree/v0.10.9"
+            },
+            "time": "2021-10-10T13:37:39+00:00"
         },
         {
@@ -2593,14 +2678,14 @@
         {
             "name": "ramsey/collection",
-            "version": "1.2.1",
+            "version": "1.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/ramsey/collection.git",
-                "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/ramsey/collection/zipball/eaca1dc1054ddd10cbd83c1461907bee6fb528fa",
-                "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa",
+                "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a",
+                "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a",
                 "shasum": ""
             },
@@ -2656,5 +2741,5 @@
             "support": {
                 "issues": "https://github.com/ramsey/collection/issues",
-                "source": "https://github.com/ramsey/collection/tree/1.2.1"
+                "source": "https://github.com/ramsey/collection/tree/1.2.2"
             },
             "funding": [
@@ -2668,5 +2753,5 @@
                 }
             ],
-            "time": "2021-08-06T03:41:06+00:00"
+            "time": "2021-10-10T03:01:02+00:00"
         },
         {
@@ -2770,14 +2855,14 @@
         {
             "name": "swiftmailer/swiftmailer",
-            "version": "v6.2.7",
+            "version": "v6.3.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/swiftmailer/swiftmailer.git",
-                "reference": "15f7faf8508e04471f666633addacf54c0ab5933"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/15f7faf8508e04471f666633addacf54c0ab5933",
-                "reference": "15f7faf8508e04471f666633addacf54c0ab5933",
+                "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8a5d5072dca8f48460fce2f4131fcc495eec654c",
+                "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c",
                 "shasum": ""
             },
@@ -2791,5 +2876,5 @@
             "require-dev": {
                 "mockery/mockery": "^1.0",
-                "symfony/phpunit-bridge": "^4.4|^5.0"
+                "symfony/phpunit-bridge": "^4.4|^5.4"
             },
             "suggest": {
@@ -2829,5 +2914,5 @@
             "support": {
                 "issues": "https://github.com/swiftmailer/swiftmailer/issues",
-                "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.7"
+                "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.3.0"
             },
             "funding": [
@@ -2841,5 +2926,5 @@
                 }
             ],
-            "time": "2021-03-09T12:30:35+00:00"
+            "time": "2021-10-18T15:26:12+00:00"
         },
         {
@@ -5153,29 +5238,29 @@
         {
             "name": "vlucas/phpdotenv",
-            "version": "v5.3.0",
+            "version": "v5.3.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/vlucas/phpdotenv.git",
-                "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",
-                "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",
+                "reference": "accaddf133651d4b5cf81a119f25296736ffc850"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850",
+                "reference": "accaddf133651d4b5cf81a119f25296736ffc850",
                 "shasum": ""
             },
             "require": {
                 "ext-pcre": "*",
-                "graham-campbell/result-type": "^1.0.1",
+                "graham-campbell/result-type": "^1.0.2",
                 "php": "^7.1.3 || ^8.0",
-                "phpoption/phpoption": "^1.7.4",
-                "symfony/polyfill-ctype": "^1.17",
-                "symfony/polyfill-mbstring": "^1.17",
-                "symfony/polyfill-php80": "^1.17"
+                "phpoption/phpoption": "^1.8",
+                "symfony/polyfill-ctype": "^1.23",
+                "symfony/polyfill-mbstring": "^1.23.1",
+                "symfony/polyfill-php80": "^1.23.1"
             },
             "require-dev": {
                 "bamarni/composer-bin-plugin": "^1.4.1",
                 "ext-filter": "*",
-                "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1"
+                "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10"
             },
             "suggest": {
@@ -5200,11 +5285,9 @@
                 {
                     "name": "Graham Campbell",
-                    "email": "graham@alt-three.com",
-                    "homepage": "https://gjcampbell.co.uk/"
+                    "email": "hello@gjcampbell.co.uk"
                 },
                 {
                     "name": "Vance Lucas",
-                    "email": "vance@vancelucas.com",
-                    "homepage": "https://vancelucas.com/"
+                    "email": "vance@vancelucas.com"
                 }
             ],
@@ -5217,5 +5300,5 @@
             "support": {
                 "issues": "https://github.com/vlucas/phpdotenv/issues",
-                "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0"
+                "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1"
             },
             "funding": [
@@ -5229,5 +5312,5 @@
                 }
             ],
-            "time": "2021-01-20T15:23:13+00:00"
+            "time": "2021-10-02T19:24:42+00:00"
         },
         {
@@ -5501,17 +5584,18 @@
         {
             "name": "facade/ignition",
-            "version": "2.13.1",
+            "version": "2.15.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/facade/ignition.git",
-                "reference": "e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/facade/ignition/zipball/e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78",
-                "reference": "e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78",
-                "shasum": ""
-            },
-            "require": {
+                "reference": "3ee6e94815462bcf09bca0efc1c9069685df8da3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/facade/ignition/zipball/3ee6e94815462bcf09bca0efc1c9069685df8da3",
+                "reference": "3ee6e94815462bcf09bca0efc1c9069685df8da3",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
                 "ext-json": "*",
                 "ext-mbstring": "*",
@@ -5573,5 +5657,5 @@
                 "source": "https://github.com/facade/ignition"
             },
-            "time": "2021-09-13T13:01:30+00:00"
+            "time": "2021-10-11T15:24:06+00:00"
         },
         {
@@ -5695,19 +5779,19 @@
         {
             "name": "filp/whoops",
-            "version": "2.14.3",
+            "version": "2.14.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/filp/whoops.git",
-                "reference": "89584ce67dd32307f1063cc43846674f4679feda"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/filp/whoops/zipball/89584ce67dd32307f1063cc43846674f4679feda",
-                "reference": "89584ce67dd32307f1063cc43846674f4679feda",
+                "reference": "f056f1fe935d9ed86e698905a957334029899895"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/filp/whoops/zipball/f056f1fe935d9ed86e698905a957334029899895",
+                "reference": "f056f1fe935d9ed86e698905a957334029899895",
                 "shasum": ""
             },
             "require": {
                 "php": "^5.5.9 || ^7.0 || ^8.0",
-                "psr/log": "^1.0.1"
+                "psr/log": "^1.0.1 || ^2.0 || ^3.0"
             },
             "require-dev": {
@@ -5754,5 +5838,5 @@
             "support": {
                 "issues": "https://github.com/filp/whoops/issues",
-                "source": "https://github.com/filp/whoops/tree/2.14.3"
+                "source": "https://github.com/filp/whoops/tree/2.14.4"
             },
             "funding": [
@@ -5762,5 +5846,5 @@
                 }
             ],
-            "time": "2021-09-19T12:00:00+00:00"
+            "time": "2021-10-03T12:00:00+00:00"
         },
         {
@@ -5817,14 +5901,14 @@
         {
             "name": "laravel/sail",
-            "version": "v1.10.2",
+            "version": "v1.12.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/sail.git",
-                "reference": "0b9ddae87b5867e0ca3a68f3b645079054c7ace3"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/laravel/sail/zipball/0b9ddae87b5867e0ca3a68f3b645079054c7ace3",
-                "reference": "0b9ddae87b5867e0ca3a68f3b645079054c7ace3",
+                "reference": "80f6cd93844e87ebc2e7310f9a9b9917473f5eb0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel/sail/zipball/80f6cd93844e87ebc2e7310f9a9b9917473f5eb0",
+                "reference": "80f6cd93844e87ebc2e7310f9a9b9917473f5eb0",
                 "shasum": ""
             },
@@ -5873,5 +5957,5 @@
                 "source": "https://github.com/laravel/sail"
             },
-            "time": "2021-09-28T15:33:02+00:00"
+            "time": "2021-10-12T15:38:11+00:00"
         },
         {
@@ -6314,14 +6398,14 @@
         {
             "name": "phpdocumentor/type-resolver",
-            "version": "1.5.0",
+            "version": "1.5.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f",
-                "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f",
+                "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
+                "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
                 "shasum": ""
             },
@@ -6358,7 +6442,7 @@
             "support": {
                 "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
-                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0"
-            },
-            "time": "2021-09-17T15:28:14+00:00"
+                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
+            },
+            "time": "2021-10-02T14:08:47+00:00"
         },
         {
@@ -7703,4 +7787,5 @@
                 }
             ],
+            "abandoned": true,
             "time": "2020-09-28T06:45:17+00:00"
         },
Index: database/factories/DepartmentFactory.php
===================================================================
--- database/factories/DepartmentFactory.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ database/factories/DepartmentFactory.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -24,10 +24,10 @@
     public function definition()
     {
-        $location = $this->faker->unique()->numberBetween(1, 25);
+        $location = $this->faker->randomNumber('1', '1');
         Storage::disk('local')->makeDirectory('Departments/' . $location);
         return [
-            'name' => $this->faker->firstName() . " department",
+            'name' => "Department" . $this->faker->unique()->firstName(),
             'code' => $location,
-            'location' => Storage::disk('local')->path('') . 'Departments/' . $location,
+            'location' => Storage::disk('local')->path('') . 'Departments' . DIRECTORY_SEPARATOR . $location,
             'user_id' => $this->faker->numberBetween('1', '2'),
             'created_at' => Carbon::now()
Index: database/factories/DocumentFactory.php
===================================================================
--- database/factories/DocumentFactory.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ database/factories/DocumentFactory.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -26,9 +26,11 @@
     {
 
-        $deptID = $this->faker->numberBetween('1', '25');
+        $deptID = "1";
+        $name = $this->faker->unique()->firstName();
+        Storage::disk('local')->makeDirectory('Departments' . DIRECTORY_SEPARATOR . $deptID . DIRECTORY_SEPARATOR . $name);
 
         return [
             'arch_id' => $deptID . "/" . $this->faker->unique()->randomNumber(),
-            'name' => $this->faker->unique()->firstName(),
+            'name' => $name,
             'description' => $this->faker->realText(),
             'user_id' => $this->faker->numberBetween('1', '2'),
Index: database/seeders/DepartmentsTableSeeder.php
===================================================================
--- database/seeders/DepartmentsTableSeeder.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ database/seeders/DepartmentsTableSeeder.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -16,5 +16,5 @@
     public function run()
     {
-        Department::factory()->count(25)->create();
+        Department::factory()->count(10)->create();
     }
 }
Index: resources/views/dashboard/departments/index.blade.php
===================================================================
--- resources/views/dashboard/departments/index.blade.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ resources/views/dashboard/departments/index.blade.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -67,5 +67,5 @@
                                     @endif
                                     <!-- Trigger -->
-                                    <td>{!! Str::substr($department->location , strlen(Storage::disk('local')->path(''))) !!}
+                                    <td>{{ $department->location }}
                                             <button class="btn btn-sm btn-primary text-white" data-clipboard-target="#copy_{{ $department->id }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
                                                     <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
@@ -112,7 +112,4 @@
                             </tbody>
                         </table>
-
-
-
                     </div>
                 </div>
Index: resources/views/dashboard/documents/edit.blade.php
===================================================================
--- resources/views/dashboard/documents/edit.blade.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ resources/views/dashboard/documents/edit.blade.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -65,5 +65,9 @@
                                             </div>
                                         </div>
-
+                                        <div class="row">
+                                            <div class="col-md-6">
+                                                <input type="file" class="form-control" id="file-item" name="file_item[]" multiple>
+                                            </div>
+                                        </div>
 
                                         <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
Index: resources/views/dashboard/documents/index.blade.php
===================================================================
--- resources/views/dashboard/documents/index.blade.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ resources/views/dashboard/documents/index.blade.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -23,10 +23,9 @@
                             <i data-feather="folder" class="width-15 height-15 mr-2"></i>
                             Documents
-{{--                            <span class="small ml-auto">{{$totalDocs}}</span>--}}
                         </a>
                         @foreach($departments as $department)
                             <a href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center">
-                                <i data-feather="folder" class="width-15 height-15 mr-2"></i>
-                                {{$department->name}}
+                                 <i data-feather="folder" class="width-15 height-15 mr-2"></i>
+                                 {{$department->name}}
                                 <span class="small ml-auto">{{$department->document->count()}}</span>
                             </a>
@@ -63,6 +62,4 @@
             </div>
         </div>
-
-
         <div class="col-md-9 app-content">
             <div class="app-content-overlay"></div>
@@ -76,5 +73,4 @@
                             </a>
                             <div class="dropdown-menu">
-                                <a class="dropdown-item" href="{{route("dashboard.departments.create")}}">Department</a>
                                 <a class="dropdown-item" href="{{route("dashboard.documents.create")}}">Document</a>
                             </div>
@@ -123,5 +119,10 @@
                 </div>
             </div>
-            <p>Documents</p>
+            @if(!Request::query('id'))
+                <h4>Documents</h4><br/>
+            @else
+                <h4> {{ $deptName }} - {{$deptCode}} </h4>
+            <br/>
+                @endif
             <div class="row">
                 @forelse($documents as $document)
Index: sources/views/dashboard/documents/search.blade.php
===================================================================
--- resources/views/dashboard/documents/search.blade.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ 	(revision )
@@ -1,166 +1,0 @@
-{{--@extends('layouts.app')--}}
-
-{{--@section("title", "SaveSpace - Documents")--}}
-
-{{--@section('pageTitle', 'SaveSpace - Documents')--}}
-
-{{--@section('content')--}}
-
-{{--    <div class="row app-block mb-4">--}}
-{{--        <div class="col-md-3 app-sidebar">--}}
-{{--            <div class="card">--}}
-{{--                <div class="card-body">--}}
-{{--                    <a href="{{ route("dashboard.documents.create") }}" class="btn btn-secondary btn-block file-upload-btn text-white" data-action="{{ route("dashboard.documents.create") }}">--}}
-{{--                        Add document--}}
-{{--                    </a>--}}
-{{--                    <form class="d-none" id="file-upload">--}}
-{{--                        <input type="file" multiple>--}}
-{{--                    </form>--}}
-{{--                </div>--}}
-{{--                <div class="app-sidebar-menu">--}}
-{{--                    <div class="list-group list-group-flush">--}}
-{{--                        <a href="{{route("dashboard.documents.index")}}" class="list-group-item d-flex align-items-center">--}}
-{{--                            <i data-feather="folder" class="width-15 height-15 mr-2"></i>--}}
-{{--                            Documents--}}
-{{--                        </a>--}}
-{{--                        @foreach($departments as $department)--}}
-{{--                            <a href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center">--}}
-{{--                                <i data-feather="folder" class="width-15 height-15 mr-2"></i>--}}
-{{--                                {{$department->name}}--}}
-{{--                                <span class="small ml-auto">{{$department->document->count()}}</span>--}}
-{{--                            </a>--}}
-{{--                        @endforeach--}}
-{{--                        <a href="" class="list-group-item">--}}
-{{--                            <i data-feather="upload-cloud" class="width-15 height-15 mr-2"></i>--}}
-{{--                            Recents--}}
-{{--                        </a>--}}
-{{--                        <a href="{{ URL::current()."?sort=important" }}" class="list-group-item d-flex align-items-center">--}}
-{{--                            <i data-feather="star" class="width-15 height-15 mr-2"></i>--}}
-{{--                            Important--}}
-{{--                            <span class="small ml-auto">{{ $countImportant }}</span>--}}
-{{--                        </a>--}}
-{{--                        <a href="" class="list-group-item">--}}
-{{--                            <i data-feather="trash" class="width-15 height-15 mr-2"></i>--}}
-{{--                            Deleted Files--}}
-{{--                        </a>--}}
-{{--                    </div>--}}
-{{--                    <div class="card-body">--}}
-{{--                        <h6 class="mb-4">Storage Status</h6>--}}
-{{--                        <div class="d-flex align-items-center">--}}
-{{--                            <div class="mr-3">--}}
-{{--                                <i data-feather="database" class="width-30 height-30"></i>--}}
-{{--                            </div>--}}
-{{--                            <div class="flex-grow-1">--}}
-{{--                                <div class="progress" style="height: 10px">--}}
-{{--                                    <div class="progress-bar progress-bar-striped" role="progressbar"--}}
-{{--                                         style="width: 40%" aria-valuenow="10" aria-valuemin="0"--}}
-{{--                                         aria-valuemax="100"></div>--}}
-{{--                                </div>--}}
-{{--                                <div class="line-height-12 small text-muted mt-2">19.5GB used of 25GB</div>--}}
-{{--                            </div>--}}
-{{--                        </div>--}}
-{{--                    </div>--}}
-{{--                </div>--}}
-{{--            </div>--}}
-{{--        </div>--}}
-
-{{--        <div class="col-md-9 app-content">--}}
-{{--            <div class="app-content-overlay"></div>--}}
-{{--            <div class="app-action">--}}
-{{--                <div class="action-left">--}}
-{{--                    <ul class="list-inline">--}}
-{{--                        <li class="list-inline-item mb-0">--}}
-{{--                            <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">--}}
-{{--                                <i data-feather="plus" class="mr-1"></i>--}}
-{{--                                Add--}}
-{{--                            </a>--}}
-{{--                            <div class="dropdown-menu">--}}
-{{--                                <a class="dropdown-item" href="{{route("dashboard.departments.create")}}">Department</a>--}}
-{{--                                <a class="dropdown-item" href="{{route("dashboard.documents.create")}}">Document</a>--}}
-{{--                            </div>--}}
-{{--                        </li>--}}
-{{--                        <li class="list-inline-item mb-0">--}}
-{{--                            <a href="#" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">Departments</a>--}}
-{{--                            <div class="dropdown-menu">--}}
-{{--                                @foreach($departments as $department)--}}
-{{--                                    <a class="dropdown-item d-flex justify-content-between m-5" href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}">--}}
-{{--                                        {{$department->name}}--}}
-{{--                                        <span class="text-muted">{{$department->document->count()}}</span>--}}
-{{--                                    </a>--}}
-{{--                                @endforeach--}}
-{{--                            </div>--}}
-{{--                        </li>--}}
-{{--                    </ul>--}}
-{{--                </div>--}}
-{{--                <div class="action-right">--}}
-{{--                    <form action="{{ route("dashboard.documents.search") }}" method="get" class="d-flex mr-3">--}}
-{{--                        <div class="input-group">--}}
-{{--                            <input type="text" name="q" class="form-control" placeholder="Search file"--}}
-{{--                                   aria-describedby="button-addon1" name="q" required>--}}
-{{--                            <div class="input-group-append">--}}
-{{--                                <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">--}}
-{{--                                    <i data-feather="search"></i>--}}
-{{--                                </button>--}}
-{{--                            </div>--}}
-{{--                        </div>--}}
-{{--                    </form>--}}
-{{--                </div>--}}
-{{--            </div>--}}
-{{--            <p>Search results</p>--}}
-
-{{--            <div class="row">--}}
-{{--                @forelse($results as $document)--}}
-{{--                    <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">--}}
-{{--                        <div class="card app-file-list">--}}
-{{--                            <div class="app-file-icon">--}}
-{{--                                <i class="fa fa-file-text-o text-primary"></i>--}}
-{{--                                <div class="dropdown position-absolute top-0 right-0 mr-3">--}}
-{{--                                    <a href="#" class="btn btn-outline-light btn-sm" data-toggle="dropdown">--}}
-{{--                                        <i class="fa fa-ellipsis-h"></i>--}}
-{{--                                    </a>--}}
-{{--                                    <div class="dropdown-menu dropdown-menu-right">--}}
-{{--                                        <a href="{{ route("dashboard.documents.edit", ["id" => $document->id]) }}" class="dropdown-item">View Details</a>--}}
-{{--                                        <a href="#" class="dropdown-item">Share</a>--}}
-{{--                                        <a href="#" class="dropdown-item">Download</a>--}}
-{{--                                        <button class="dropdown-item action-dropdown-item"--}}
-{{--                                                href="javascript:void(0)" onclick="toggleImportant({{$document->id}})">--}}
-{{--                                            @if($document->is_important)--}}
-{{--                                                Mark as not important--}}
-{{--                                            @else--}}
-{{--                                                Mark as important--}}
-{{--                                            @endif--}}
-{{--                                        </button>--}}
-{{--                                        <a href="#" class="dropdown-item">Delete</a>--}}
-{{--                                    </div>--}}
-{{--                                </div>--}}
-{{--                            </div>--}}
-{{--                            <div class="p-2 small">--}}
-{{--                                @if($document->is_important)--}}
-{{--                                    <div>{{$document->name}} - {{$document->arch_id}} <i class="fa fa-star" style="color:orange"></i></div>--}}
-{{--                                @else--}}
-{{--                                    <div>{{$document->name}} - {{$document->arch_id}} </div>--}}
-{{--                                @endif--}}
-{{--                                <div>{{$document->created_at}}</div>--}}
-{{--                                <div class="text-muted">{{$document->description}}</div>--}}
-{{--                                <div class="text-muted">1.2MB</div>--}}
-{{--                            </div>--}}
-{{--                        </div>--}}
-{{--                    </div>--}}
-{{--                    <form id="toggleImportant_{{ $document->id }}"--}}
-{{--                          action="{{ route("dashboard.documents.toggleImportant", ["id" => $document->id]) }}"--}}
-{{--                          method="post">--}}
-{{--                        @csrf--}}
-{{--                        @method("patch")--}}
-{{--                    </form>--}}
-{{--                @empty--}}
-{{--                    <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>--}}
-{{--                @endforelse--}}
-
-{{--            </div>--}}
-{{--        </div>--}}
-
-{{--@endsection--}}
-
-{{--@section('script')--}}
-
-{{--@endsection--}}
Index: routes/web.php
===================================================================
--- routes/web.php	(revision e6c1f87d9981de7492736e12f9cc56fc273c8e2a)
+++ routes/web.php	(revision b9c4a92282ce0d7aa095082d7109f6d3d7b68dad)
@@ -94,4 +94,3 @@
     Route::delete("/documents/{id}/destroy", "Dashboard\DocumentsController@destroy")->name("dashboard.documents.destroy");
     Route::patch('/documents/toggle-important/{id}', "Dashboard\DocumentsController@toggleImportant")->name("dashboard.documents.toggleImportant");
-
 });
