- Timestamp:
- 10/19/21 17:46:21 (3 years ago)
- Branches:
- develop, master
- Children:
- 6b95845
- Parents:
- b9c4a92
- Location:
- database
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
database/factories/DepartmentFactory.php
rb9c4a92 rea7b12a 24 24 public function definition() 25 25 { 26 $location = $this->faker-> randomNumber('1', '1');26 $location = $this->faker->unique()->numberBetween('1', '9'); 27 27 Storage::disk('local')->makeDirectory('Departments/' . $location); 28 28 return [ -
database/factories/DocumentFactory.php
rb9c4a92 rea7b12a 26 26 { 27 27 28 $deptID = " 1";28 $deptID = "5"; 29 29 $name = $this->faker->unique()->firstName(); 30 30 Storage::disk('local')->makeDirectory('Departments' . DIRECTORY_SEPARATOR . $deptID . DIRECTORY_SEPARATOR . $name); -
database/migrations/2021_10_10_103309_create_files_table.php
rb9c4a92 rea7b12a 16 16 Schema::create('files', function (Blueprint $table) { 17 17 $table->bigIncrements('id'); 18 $table->bigInteger('document_id')->unsigned()->nullable(); 19 $table->string("link"); 18 $table->bigInteger('document_id')->unsigned(); 19 $table->string("name"); 20 $table->string("location"); 20 21 $table->foreign("document_id")->references("id")->on("documents"); 21 22 $table->timestamps(); -
database/seeders/DatabaseSeeder.php
rb9c4a92 rea7b12a 19 19 $this->call(UsersTableSeeder::class); 20 20 $this->call(DepartmentsTableSeeder::class); 21 $this->call(DocumentsTableSeeder::class);21 //$this->call(DocumentsTableSeeder::class); 22 22 } 23 23 } -
database/seeders/DepartmentsTableSeeder.php
rb9c4a92 rea7b12a 16 16 public function run() 17 17 { 18 Department::factory()->count( 10)->create();18 Department::factory()->count(8)->create(); 19 19 } 20 20 } -
database/seeders/DocumentsTableSeeder.php
rb9c4a92 rea7b12a 106 106 // ], 107 107 // ]); 108 Document::factory()->count( 300)->create();108 Document::factory()->count(10)->create(); 109 109 } 110 110 }
Note:
See TracChangeset
for help on using the changeset viewer.