Advertisement
Guest User

Untitled

a guest
Jun 15th, 2020
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Seeder;
  4. use Illuminate\Support\Facades\DB;
  5.  
  6. class ParentChildSeeder extends Seeder
  7. {
  8.     /**
  9.      * Run the database seeds.
  10.      *
  11.      * @return void
  12.      */
  13.     public function run()
  14.     {
  15.         DB::table('parent_child')->insert([
  16.             'parent_id' => 1,
  17.             'child_id' => 2,
  18.         ]);
  19.         DB::table('parent_child')->insert([
  20.             'parent_id' => 1,
  21.             'child_id' => 3,
  22.         ]);
  23.  
  24.         DB::table('parent_child')->insert([
  25.             'parent_id' => 2,
  26.             'child_id' => 4,
  27.         ]);
  28.         DB::table('parent_child')->insert([
  29.             'parent_id' => 2,
  30.             'child_id' => 5,
  31.         ]);
  32.         DB::table('parent_child')->insert([
  33.             'parent_id' => 2,
  34.             'child_id' => 6,
  35.         ]);
  36.  
  37.         DB::table('parent_child')->insert([
  38.             'parent_id' => 3,
  39.             'child_id' => 7,
  40.         ]);
  41.         DB::table('parent_child')->insert([
  42.             'parent_id' => 3,
  43.             'child_id' => 8,
  44.         ]);
  45.         DB::table('parent_child')->insert([
  46.             'parent_id' => 3,
  47.             'child_id' => 9,
  48.         ]);
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement