Index: resources/views/dashboard/departments/create.blade.php
===================================================================
--- resources/views/dashboard/departments/create.blade.php	(revision 120759b41a3ce01c1ab16d5c512103522ae5568f)
+++ resources/views/dashboard/departments/create.blade.php	(revision d795fa6d6f9dce899a9ce38b85983b77c28a7e19)
@@ -1,5 +1,5 @@
 @extends('layouts.app')
 
-@section("title", "Departments - Create new")
+@section("title", "Departments - Create department")
 
 @section('pageTitle', 'Create department')
@@ -28,5 +28,5 @@
                                 <div class="card-body">
                                     <h6 class="card-title">New department</h6>
-                                    <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8">
+                                    <form action="{{ route("dashboard.departments.store") }}" method="post" accept-charset="utf-8" class="needs-validation" novalidate>
                                         @csrf
                                         <div class="row">
@@ -34,5 +34,8 @@
                                                 <div class="form-group">
                                                     <label>Name</label>
-                                                    <input type="text" name="name" value="{{ old('name') }}" class="form-control" placeholder="Name" required>
+                                                    <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
+                                                    <div class="invalid-feedback">
+                                                        Please enter characters with length between [2, 30]
+                                                    </div>
                                                 </div>
                                             </div>
@@ -40,5 +43,8 @@
                                                 <div class="form-group">
                                                     <label>Code</label>
-                                                    <input type="text" name="code" value="{{ old('code') }}" class="form-control" placeholder="Code" required>
+                                                    <input type="text" name="code" value="{{ old('code') }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>
+                                                    <div class="invalid-feedback">
+                                                        Please enter characters with length between [2, 30]
+                                                    </div>
                                                 </div>
                                             </div>
Index: resources/views/dashboard/departments/edit.blade.php
===================================================================
--- resources/views/dashboard/departments/edit.blade.php	(revision 120759b41a3ce01c1ab16d5c512103522ae5568f)
+++ resources/views/dashboard/departments/edit.blade.php	(revision d795fa6d6f9dce899a9ce38b85983b77c28a7e19)
@@ -28,5 +28,5 @@
                                 <div class="card-body">
                                     <h6 class="card-title">Departmnets</h6>
-                                    <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8">
+                                    <form action="{{ route("dashboard.departments.edit", ["id" =>$department->id]) }}" method="post" accept-charset="utf-8" class="needs-validation" novalidate>
                                         @method("patch")
                                         @csrf
@@ -35,5 +35,8 @@
                                                 <div class="form-group">
                                                     <label class="form-label">Name</label>
-                                                    <input type="text" name="name" value="{{ $department->name }}" class="form-control" placeholder="Name" required>
+                                                    <input type="text" name="name" value="{{ $department->name }}" minlength="2" maxlength="30" class="form-control" placeholder="Name" required>
+                                                    <div class="invalid-feedback">
+                                                        Please enter characters with length between [2, 30]
+                                                    </div>
                                                 </div>
                                             </div>
@@ -41,5 +44,8 @@
                                                 <div class="form-group">
                                                     <label class="form-label">Code</label>
-                                                    <input type="text" name="code" value="{{ $department->code }}" class="form-control" placeholder="Code" required>
+                                                    <input type="text" name="code" value="{{ $department->code }}" minlength="2" maxlength="30" class="form-control" placeholder="Code" required>
+                                                    <div class="invalid-feedback">
+                                                        Please enter characters with length between [2, 30]
+                                                    </div>
                                                 </div>
                                             </div>
Index: resources/views/dashboard/departments/index.blade.php
===================================================================
--- resources/views/dashboard/departments/index.blade.php	(revision 120759b41a3ce01c1ab16d5c512103522ae5568f)
+++ resources/views/dashboard/departments/index.blade.php	(revision d795fa6d6f9dce899a9ce38b85983b77c28a7e19)
@@ -1,7 +1,7 @@
 @extends('layouts.app')
 
-@section("title", "Departments")
+@section("title", "SaveSpace - Departments")
 
-@section('pageTitle', 'Department List')
+@section('pageTitle', 'Departments')
 
 @section('head')
@@ -77,39 +77,40 @@
                                             <i class="ti-pencil"></i>
                                         </a>
-                                        <a href="javascript:void(0)" class="text-danger ml-2" data-action="{{ route("dashboard.categories.destroy", ["id" => $category->id]) }}" data-target="#deleteModal" data-toggle="modal" title="Delete">
+                                        <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$department->id}}" title="Delete">
                                             <i class="ti-trash"></i>
                                         </a>
                                     </td>
                                 </tr>
+                                <div class="modal fade" id="deleteModal_{{$department->id}}" tabindex="-1" role="dialog" aria-hidden="true">
+                                    <div class="modal-dialog modal-dialog-centered" role="document">
+                                        <div class="modal-content">
+                                            <div class="modal-header">
+                                                <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
+                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                                                    <i class="ti-close"></i>
+                                                </button>
+                                            </div>
+                                            <div class="modal-body">
+                                                <form action="{{ route("dashboard.departments.destroy", $department->id) }}" method="POST">
+                                                    @csrf
+                                                    @method('DELETE')
+                                                    <p>Are you sure you want to delete department {{$department->name}} with code: {{$department->code}}?</p>
+                                                    <p>Number of documents associated: {{$department->document()->count()}}</p>
+                                                    <div class="modal-footer">
+                                                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
+                                                        </button>
+                                                        <button type="submit" class="btn btn-primary">Save changes</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+
+                                        </div>
+                                    </div>
+                                </div>
                             @endforeach
                             </tbody>
                         </table>
 
-                        <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-hidden="true">
-                            <div class="modal-dialog modal-dialog-centered" role="document">
-                                <div class="modal-content">
-                                    <div class="modal-header">
-                                        <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
-                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                                            <i class="ti-close"></i>
-                                        </button>
-                                    </div>
-                                    <div class="modal-body">
-                                        <form action="{{ route('dashboard.departments.destroy', 'id') }}" method="post">
-                                            @csrf
-                                            @method('DELETE')
-                                            <input id="id" name="id" hidden value="">
-                                            <p>Are you sure you want to delete department <b>{{$department->name}}</b> with code <b>{{$department->code}}?</b></p>
-                                            <div class="modal-footer">
-                                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
-                                                </button>
-                                                <button type="submit" class="btn btn-danger">Save changes</button>
-                                            </div>
-                                        </form>
-                                    </div>
 
-                                </div>
-                            </div>
-                        </div>
 
                     </div>
@@ -127,7 +128,10 @@
 
     <script>
-        $(document).on('click','.delete',function(){
-            let id = $(this).attr('data-action');
-            $('#id').val(id);
+        $('#deleteModal').on('show.bs.modal', function (event) {
+            var button = $(event.relatedTarget)
+            var dep_id = button.data('deptId')
+            var modal = $(this)
+
+            modal.find('.modal-body #dept_id').val(dep_id);
         });
     </script>
