Index: database/factories/DepartmentFactory.php
===================================================================
--- database/factories/DepartmentFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/factories/DepartmentFactory.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -4,7 +4,9 @@
 
 use App\Models\Department;
+use App\Models\Folder;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Factories\Factory;
 use Illuminate\Support\Facades\Storage;
+use function Sodium\increment;
 
 class DepartmentFactory extends Factory
@@ -24,12 +26,13 @@
     public function definition()
     {
-        $location = $this->faker->unique()->numberBetween(1, 15);
+        $location = $this->faker->unique()->numberBetween(10, 25);
         Storage::disk('uploads')->makeDirectory('Departments/' . $location);
         return [
-            'name' => "Department" . $this->faker->unique()->firstName(),
+            'name' => "Department" . ' ' . $this->faker->unique()->firstName(),
             'code' => $location,
             'location' => 'Departments' . DIRECTORY_SEPARATOR . $location,
-            'user_id' => $this->faker->numberBetween('1', '2'),
-            'created_at' => Carbon::now()
+            'no_of_folders' => 0,
+            'user_id' => "1",
+            'created_at' => $this->faker->dateTime()
         ];
     }
Index: database/factories/FileFactory.php
===================================================================
--- database/factories/FileFactory.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
+++ database/factories/FileFactory.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -0,0 +1,40 @@
+<?php
+
+namespace Database\Factories;
+
+use App\Models\File;
+use App\Models\Folder;
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Facades\Storage;
+
+class FileFactory extends Factory
+{
+    /**
+     * The name of the factory's corresponding model.
+     *
+     * @var string
+     */
+    protected $model = File::class;
+
+    /**
+     * Define the model's default state.
+     *
+     * @return array
+     */
+    public function definition()
+    {
+        $folderId = $this->faker->numberBetween('1', '500');
+
+        $folder = Folder::find($folderId);
+        $name = $folder->name . ' - ' . $this->faker->unique()->date() . '.png';
+
+        $location = $folder->location . DIRECTORY_SEPARATOR . $name;
+
+        return [
+            "folder_id" => $folderId,
+            "name" => $name,
+            "location" => $location,
+            "created_at" => $this->faker->dateTime()
+        ];
+    }
+}
Index: database/factories/FolderFactory.php
===================================================================
--- database/factories/FolderFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/factories/FolderFactory.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -6,4 +6,5 @@
 use App\Models\Folder;
 use Carbon\Carbon;
+use Faker\Provider\DateTime;
 use Illuminate\Database\Eloquent\Factories\Factory;
 use Illuminate\Support\Facades\Storage;
@@ -27,4 +28,5 @@
 
         $deptId = $this->faker->numberBetween('1', '15');
+
         $deptCode = Department::find($deptId)->code;
         $name = $this->faker->unique()->firstName();
@@ -33,9 +35,8 @@
         Storage::disk('uploads')->makeDirectory($location);
 
-
         return [
             'arch_id' => $deptCode . "/" . $this->faker->unique()->randomNumber(),
             'name' => $name,
-            'note' => $this->faker->realText(),
+            'note' => "This a note field",
             'location' => $location,
             'user_id' => $this->faker->numberBetween('1', '2'),
Index: database/factories/UserFactory.php
===================================================================
--- database/factories/UserFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/factories/UserFactory.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -26,7 +26,7 @@
             'name' => $this->faker->firstName(),
             'surname' => $this->faker->lastName(),
-            'username' => $this->faker->userName(),
+            'username' => $this->faker->unique()->userName(),
             'password' => $this->faker->password(),
-            'email' => $this->faker->email(),
+            'email' => $this->faker->unique()->email(),
             'phone_number' => $this->faker->phoneNumber(),
             'role_id' => $this->faker->numberBetween(1, 2),
@@ -35,5 +35,5 @@
             'is_forgot_password' => $this->faker->boolean,
             'created_by' => "1",
-            'created_at' => Carbon::now()
+            'created_at' => now()
         ];
     }
Index: database/migrations/2021_09_29_121244_create_departments_table.php
===================================================================
--- database/migrations/2021_09_29_121244_create_departments_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/migrations/2021_09_29_121244_create_departments_table.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -16,8 +16,9 @@
         Schema::create('departments', function (Blueprint $table) {
             $table->increments('id');
-            $table->integer("user_id")->unsigned();
             $table->string("name");
             $table->string("code");
+            $table->integer("user_id")->unsigned();
             $table->string("location");
+            $table->integer("no_of_folders")->default(0);
             $table->timestamps();
 
Index: database/migrations/2021_10_06_103305_create_folders_table.php
===================================================================
--- database/migrations/2021_10_06_103305_create_folders_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/migrations/2021_10_06_103305_create_folders_table.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -20,4 +20,5 @@
             $table->text("note")->nullable();
             $table->string("location");
+            $table->integer("no_of_files")->default(0);
             $table->integer("user_id")->unsigned();
             $table->integer("department_id")->unsigned();
Index: database/migrations/2021_10_21_144552_create_file_types_table.php
===================================================================
--- database/migrations/2021_10_21_144552_create_file_types_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/migrations/2021_10_21_144552_create_file_types_table.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -16,5 +16,5 @@
         Schema::create('file_types', function (Blueprint $table) {
             $table->increments('id');
-            $table->string("mimes")->default('mimes:');
+            $table->string("mimes")->default('jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx');
             $table->integer("max_size");
             $table->integer("user_id")->unsigned();
Index: database/seeders/DatabaseSeeder.php
===================================================================
--- database/seeders/DatabaseSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/DatabaseSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -19,6 +19,7 @@
         $this->call(UsersTableSeeder::class);
         $this->call(DepartmentsTableSeeder::class);
-        $this->call(FileTypeSeeder::class);
+        $this->call(FileTypesTableSeeder::class);
         $this->call(FoldersTableSeeder::class);
+        $this->call(FilesTableSeeder::class);
     }
 }
Index: database/seeders/DepartmentsTableSeeder.php
===================================================================
--- database/seeders/DepartmentsTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/DepartmentsTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -4,4 +4,6 @@
 
 use App\Models\Department;
+use App\Models\Folder;
+use App\Models\User;
 use Carbon\Carbon;
 use Illuminate\Database\Seeder;
Index: database/seeders/FileTypeSeeder.php
===================================================================
--- database/seeders/FileTypeSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-
-namespace Database\Seeders;
-
-use Carbon\Carbon;
-use Illuminate\Database\Seeder;
-
-class FileTypeSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \DB::table("file_types")->insert([
-            "mimes" => "mimes:jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx",
-            "max_size" => "5000",
-            "user_id" => "1",
-            "created_at" => Carbon::now()
-        ]);
-    }
-}
Index: database/seeders/FileTypesTableSeeder.php
===================================================================
--- database/seeders/FileTypesTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
+++ database/seeders/FileTypesTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -0,0 +1,24 @@
+<?php
+
+namespace Database\Seeders;
+
+use Carbon\Carbon;
+use Illuminate\Database\Seeder;
+
+class FileTypesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        \DB::table("file_types")->insert([
+            "mimes" => "jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx",
+            "max_size" => "5000",
+            "user_id" => "1",
+            "created_at" => Carbon::now()
+        ]);
+    }
+}
Index: database/seeders/FilesTableSeeder.php
===================================================================
--- database/seeders/FilesTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
+++ database/seeders/FilesTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -0,0 +1,19 @@
+<?php
+
+namespace Database\Seeders;
+
+use App\Models\File;
+use Illuminate\Database\Seeder;
+
+class FilesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        File::factory()->count(50)->create();
+    }
+}
Index: database/seeders/FoldersTableSeeder.php
===================================================================
--- database/seeders/FoldersTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/FoldersTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -3,4 +3,5 @@
 namespace Database\Seeders;
 
+use App\Models\Department;
 use App\Models\Folder;
 use Carbon\Carbon;
@@ -16,5 +17,10 @@
     public function run()
     {
-        Folder::factory()->count(300)->create();
+        Folder::factory()->count(500)->create();
+        $folders = Folder::all();
+
+        foreach ($folders as $folder) {
+            $folder->department()->increment('no_of_folders');
+        }
     }
 }
Index: database/seeders/UsersTableSeeder.php
===================================================================
--- database/seeders/UsersTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/UsersTableSeeder.php	(revision 4b7e2d354e16238fe8e560dc6dd0849218183335)
@@ -27,8 +27,8 @@
             "is_confirmed" => true,
             "created_by" => "1",
-            "created_at" => Carbon::now()
+            "created_at" => now()
         ]);
 
-        User::factory()->count(20)->create();
+        User::factory()->count(50)->create();
 
     }
