Index: database/factories/DepartmentFactory.php
===================================================================
--- database/factories/DepartmentFactory.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/factories/DepartmentFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -24,10 +24,10 @@
     public function definition()
     {
-        $location = $this->faker->unique()->numberBetween('1', '9');
-        Storage::disk('local')->makeDirectory('Departments/' . $location);
+        $location = $this->faker->unique()->numberBetween(1, 15);
+        Storage::disk('uploads')->makeDirectory('Departments/' . $location);
         return [
             'name' => "Department" . $this->faker->unique()->firstName(),
             'code' => $location,
-            'location' => Storage::disk('local')->path('') . 'Departments' . DIRECTORY_SEPARATOR . $location,
+            'location' => '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 ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ 	(revision )
@@ -1,43 +1,0 @@
-<?php
-
-namespace Database\Factories;
-
-use App\Models\Department;
-use App\Models\Document;
-use Carbon\Carbon;
-use Illuminate\Database\Eloquent\Factories\Factory;
-use Illuminate\Support\Facades\Storage;
-
-class DocumentFactory extends Factory
-{
-    /**
-     * The name of the factory's corresponding model.
-     *
-     * @var string
-     */
-    protected $model = Document::class;
-
-    /**
-     * Define the model's default state.
-     *
-     * @return array
-     */
-    public function definition()
-    {
-
-        $deptID = "5";
-        $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' => $name,
-            'description' => $this->faker->realText(),
-            'user_id' => $this->faker->numberBetween('1', '2'),
-            'department_id' => $deptID,
-            'is_important' => $this->faker->boolean,
-            'created_at' => $this->faker->dateTime()
-        ];
-
-    }
-}
Index: database/factories/FolderFactory.php
===================================================================
--- database/factories/FolderFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/factories/FolderFactory.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,47 @@
+<?php
+
+namespace Database\Factories;
+
+use App\Models\Department;
+use App\Models\Folder;
+use Carbon\Carbon;
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Facades\Storage;
+
+class FolderFactory extends Factory
+{
+    /**
+     * The name of the factory's corresponding model.
+     *
+     * @var string
+     */
+    protected $model = Folder::class;
+
+    /**
+     * Define the model's default state.
+     *
+     * @return array
+     */
+    public function definition()
+    {
+
+        $deptId = $this->faker->numberBetween('1', '15');
+        $deptCode = Department::find($deptId)->code;
+        $name = $this->faker->unique()->firstName();
+
+        $location = 'Departments' . DIRECTORY_SEPARATOR . $deptCode . DIRECTORY_SEPARATOR . $name;
+        Storage::disk('uploads')->makeDirectory($location);
+
+
+        return [
+            'arch_id' => $deptCode . "/" . $this->faker->unique()->randomNumber(),
+            'name' => $name,
+            'note' => $this->faker->realText(),
+            'location' => $location,
+            'user_id' => $this->faker->numberBetween('1', '2'),
+            'department_id' => $deptId,
+            'is_important' => $this->faker->boolean,
+            'created_at' => $this->faker->dateTime()
+        ];
+    }
+}
Index: database/migrations/2021_09_27_171107_create_users_table.php
===================================================================
--- database/migrations/2021_09_27_171107_create_users_table.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/migrations/2021_09_27_171107_create_users_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -20,5 +20,4 @@
             $table->string('surname');
             $table->string('username')->unique();
-            $table->string('password');
             $table->string('email')->unique();
             $table->string('phone_number')->unique();
@@ -30,7 +29,8 @@
             $table->boolean('is_confirmed')->default(false);
             $table->boolean('is_forgot_password')->default(false);
+            $table->integer("created_by")->unsigned();
             $table->integer('security_code')->nullable();
             $table->string('verify_token')->nullable();
-            $table->integer("created_by")->unsigned();
+            $table->string('password');
             $table->rememberToken();
             $table->timestamps();
Index: database/migrations/2021_10_06_103305_create_documents_table.php
===================================================================
--- database/migrations/2021_10_06_103305_create_documents_table.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateDocumentsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('documents', function (Blueprint $table) {
-            $table->bigIncrements('id');
-            $table->string("arch_id")->unique();
-            $table->string("name");
-            $table->text("description");
-            $table->integer("user_id")->unsigned();
-            $table->integer("department_id")->unsigned();
-            $table->boolean("is_important")->default(true);
-            $table->timestamps();
-
-            $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
-            $table->foreign("department_id")->references("id")->on("departments")->onDelete("cascade")->onUpdate("cascade");
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('documents');
-    }
-}
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 c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFoldersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('folders', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string("arch_id")->unique();
+            $table->string("name");
+            $table->text("note")->nullable();
+            $table->string("location");
+            $table->integer("user_id")->unsigned();
+            $table->integer("department_id")->unsigned();
+            $table->boolean("is_important")->default(false);
+            $table->timestamps();
+
+            $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
+            $table->foreign("department_id")->references("id")->on("departments")->onDelete("cascade")->onUpdate("cascade");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('folders');
+    }
+}
Index: database/migrations/2021_10_10_103309_create_files_table.php
===================================================================
--- database/migrations/2021_10_10_103309_create_files_table.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/migrations/2021_10_10_103309_create_files_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -16,8 +16,8 @@
         Schema::create('files', function (Blueprint $table) {
             $table->bigIncrements('id');
-            $table->bigInteger('document_id')->unsigned();
+            $table->bigInteger('folder_id')->unsigned();
             $table->string("name");
             $table->string("location");
-            $table->foreign("document_id")->references("id")->on("documents");
+            $table->foreign("folder_id")->references("id")->on("folders");
             $table->timestamps();
         });
Index: database/migrations/2021_10_21_091521_create_notifications_table.php
===================================================================
--- database/migrations/2021_10_21_091521_create_notifications_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/migrations/2021_10_21_091521_create_notifications_table.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateNotificationsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('notifications', function (Blueprint $table) {
+            $table->uuid('id')->primary();
+            $table->string('type');
+            $table->morphs('notifiable');
+            $table->text('data');
+            $table->timestamp('read_at')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('notifications');
+    }
+}
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 c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFileTypesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('file_types', function (Blueprint $table) {
+            $table->increments('id');
+            $table->string("mimes")->default('mimes:');
+            $table->integer("max_size");
+            $table->integer("user_id")->unsigned();
+            $table->timestamps();
+
+            $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('file_types');
+    }
+}
Index: database/seeders/DatabaseSeeder.php
===================================================================
--- database/seeders/DatabaseSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/seeders/DatabaseSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -19,5 +19,6 @@
         $this->call(UsersTableSeeder::class);
         $this->call(DepartmentsTableSeeder::class);
-        //$this->call(DocumentsTableSeeder::class);
+        $this->call(FileTypeSeeder::class);
+        $this->call(FoldersTableSeeder::class);
     }
 }
Index: database/seeders/DepartmentsTableSeeder.php
===================================================================
--- database/seeders/DepartmentsTableSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/seeders/DepartmentsTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -16,5 +16,5 @@
     public function run()
     {
-        Department::factory()->count(8)->create();
+        Department::factory()->count(15)->create();
     }
 }
Index: database/seeders/DocumentsTableSeeder.php
===================================================================
--- database/seeders/DocumentsTableSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ 	(revision )
@@ -1,110 +1,0 @@
-<?php
-
-namespace Database\Seeders;
-
-use App\Models\Document;
-use Carbon\Carbon;
-use Illuminate\Database\Seeder;
-
-class DocumentsTableSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-//        \DB::table('documents')->insert([
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR150",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document tests",
-//                "arch_id" => "HR1505",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "2",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR15033",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document testasd",
-//                "arch_id" => "HR150124",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "3",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR1501421",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR150213",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR150ad",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "2",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR150234",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "3",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR15012321",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR15021312",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//            [
-//                "name" => "Document test",
-//                "arch_id" => "HR15312430",
-//                "description" => "hahahah ah aha hshdash dhawud hwa",
-//                "user_id" => "1",
-//                "department_id" => "1",
-//                "created_at" => Carbon::now()->format('Y-m-d H:i:s'),
-//            ],
-//        ]);
-        Document::factory()->count(10)->create();
-    }
-}
Index: database/seeders/FileTypeSeeder.php
===================================================================
--- database/seeders/FileTypeSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/FileTypeSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,24 @@
+<?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/FoldersTableSeeder.php
===================================================================
--- database/seeders/FoldersTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
+++ database/seeders/FoldersTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -0,0 +1,20 @@
+<?php
+
+namespace Database\Seeders;
+
+use App\Models\Folder;
+use Carbon\Carbon;
+use Illuminate\Database\Seeder;
+
+class FoldersTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        Folder::factory()->count(300)->create();
+    }
+}
Index: database/seeders/PermissionsTableSeeder.php
===================================================================
--- database/seeders/PermissionsTableSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/seeders/PermissionsTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -20,12 +20,13 @@
             ["name" => "manage_all_users"], 		// Access all users to manage
             ["name" => "manage_all_departments"], 	// Access all departments to manage
-            ["name" => "manage_all_documents"], 	// Access all documents to manage
+            ["name" => "manage_all_folders"], 	    // Access all folders to manage
             ["name" => "view_all_departments"], 	// Access all departments to view
-            ["name" => "view_all_documents"], 	    // Access all documents to view
-            ["name" => "edit_all_documents"], 		// Edit all documents
-            ["name" => "edit_document"], 		    // Edit your document/s
-            ["name" => "delete_all_documents"], 	// Delete all document/s
-            ["name" => "delete_document"], 	        // Delete your document/s
-            ["name" => "manage_file_types"], 	// Access all file_types to manage
+            ["name" => "view_all_folders"], 	    // Access all folders to view
+            ["name" => "edit_all_folders"], 		// Edit all folders
+            ["name" => "edit_folder"], 		        // Edit your folder/s
+            ["name" => "delete_all_folders"], 	    // Delete all folder/s
+            ["name" => "delete_folder"], 	        // Delete your folder/s
+            ["name" => "manage_all_files"], 	    // Access all files
+            ["name" => "manage_file_types"], 	    // Access file types
         ]);
     }
Index: database/seeders/RolesPermissionsTableSeeder.php
===================================================================
--- database/seeders/RolesPermissionsTableSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/seeders/RolesPermissionsTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -27,4 +27,5 @@
             ["role_id" => 1, "permission_id" => 10],
             ["role_id" => 1, "permission_id" => 11],
+            ["role_id" => 1, "permission_id" => 12],
 
             // Referent
Index: database/seeders/RolesTableSeeder.php
===================================================================
--- database/seeders/RolesTableSeeder.php	(revision ea7b12a15d1afa472a54d5b8c75c55917907862e)
+++ database/seeders/RolesTableSeeder.php	(revision c6b84df06586305606df5b76204a64cdc63b09a2)
@@ -15,7 +15,7 @@
     {
         \DB::table('roles')->insert([
-            ["name" => "Admin"], // Have access to all users(managing users), departments, documents etc
-            ["name" => "Referent"], // Have access to manage and view all departments, documents etc
-            ["name" => "Viewer"], // Have access to view all departments, documents etc
+            ["name" => "Admin"], // Have access to all users(managing users), departments, folders etc
+            ["name" => "Referent"], // Have access to manage and view all departments, folders etc
+            ["name" => "Viewer"], // Have access to view all departments, folders etc
         ]);
     }
