Changeset 4b7e2d3 for database/seeders
- Timestamp:
- 10/23/21 04:03:46 (3 years ago)
- Branches:
- develop, master
- Children:
- b39afb5
- Parents:
- c6b84df
- Location:
- database/seeders
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
database/seeders/DatabaseSeeder.php
rc6b84df r4b7e2d3 19 19 $this->call(UsersTableSeeder::class); 20 20 $this->call(DepartmentsTableSeeder::class); 21 $this->call(FileType Seeder::class);21 $this->call(FileTypesTableSeeder::class); 22 22 $this->call(FoldersTableSeeder::class); 23 $this->call(FilesTableSeeder::class); 23 24 } 24 25 } -
database/seeders/DepartmentsTableSeeder.php
rc6b84df r4b7e2d3 4 4 5 5 use App\Models\Department; 6 use App\Models\Folder; 7 use App\Models\User; 6 8 use Carbon\Carbon; 7 9 use Illuminate\Database\Seeder; -
database/seeders/FileTypesTableSeeder.php
rc6b84df r4b7e2d3 6 6 use Illuminate\Database\Seeder; 7 7 8 class FileType Seeder extends Seeder8 class FileTypesTableSeeder extends Seeder 9 9 { 10 10 /** … … 16 16 { 17 17 \DB::table("file_types")->insert([ 18 "mimes" => " mimes:jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx",18 "mimes" => "jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx", 19 19 "max_size" => "5000", 20 20 "user_id" => "1", -
database/seeders/FoldersTableSeeder.php
rc6b84df r4b7e2d3 3 3 namespace Database\Seeders; 4 4 5 use App\Models\Department; 5 6 use App\Models\Folder; 6 7 use Carbon\Carbon; … … 16 17 public function run() 17 18 { 18 Folder::factory()->count(300)->create(); 19 Folder::factory()->count(500)->create(); 20 $folders = Folder::all(); 21 22 foreach ($folders as $folder) { 23 $folder->department()->increment('no_of_folders'); 24 } 19 25 } 20 26 } -
database/seeders/UsersTableSeeder.php
rc6b84df r4b7e2d3 27 27 "is_confirmed" => true, 28 28 "created_by" => "1", 29 "created_at" => Carbon::now()29 "created_at" => now() 30 30 ]); 31 31 32 User::factory()->count( 20)->create();32 User::factory()->count(50)->create(); 33 33 34 34 }
Note:
See TracChangeset
for help on using the changeset viewer.