pluck('id', 'internal_name')->toArray(); $countryMap= Country::all()->pluck('id', 'internal_name')->toArray(); \DB::table('tour_countries')->insert([ ['tour_id' => $tourMap['cantonese_charm'], 'country_id' => $countryMap['china']], ['tour_id' => $tourMap['fujianese_fantasy'], 'country_id' => $countryMap['china']], ['tour_id' => $tourMap['hebei_hijinx'], 'country_id' => $countryMap['china']], ]); } }