database/seeds/ComfirmTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
      $faker = Faker::create();
      $user = User::all()->pluck('id')->toArray();
      $noti = Notification::all()->pluck('id')->toArray();
      foreach (range(1,20) as $index) {
          DB::table('confirm')->insert([
            'user_id'      => $faker->randomElement($user),
            'noti_id'      => $faker->randomElement($noti),
            'code'         => 'sdfds',
            'created_at'   => now(),
            'updated_at'   => now()
          ]);
        }
    }
public function run ( ) { $ faker = Faker :: create ( ) ; $ user = User :: all ( ) -> pluck ( 'id' ) -> toArray ( ) ; $ noti = Notification :: all ( ) -> pluck ( 'id' ) -> toArray ( ) ; foreach ( range ( 1 , 20 ) as $ index ) { DB :: table ( 'confirm' ) -> insert ( [ 'user_id' => $ faker -> randomElement ( $ user ) , 'noti_id' => $ faker -> randomElement ( $ noti ) , 'code' => 'sdfds' , 'created_at' => now ( ) , 'updated_at' => now ( ) ] ) ; } }
Run the database seeds.
Run the database seeds .