$datas = DB::table('latestnews')->get();
// dd($datas);
foreach ($datas as $data) {
$desc = array(
'en' => "",
'np' => $data->description,
);
$title = array(
'en' => "",
'np' => $data->title,
);
DB::table('news')->insert([
'reporters' => '["1"]',
'news_language' => 'np',
'publish_status' => '1',
'image_show' => '1',
'postType' => 'news',
'meta_title' => 'सम्झौता अनुसार कर्णाली स्वास्थ्य विज्ञान प्रतिष्ठानमा चिकित्सा',
'meta_keyword' => 'सम्झौता अनुसार कर्णाली स्वास्थ्य विज्ञान प्रतिष्ठानमा चिकित्सा',
'meta_description' => 'सम्झौता अनुसार कर्णाली स्वास्थ्य विज्ञान प्रतिष्ठानमा चिकित्सा',
'meta_title'=>'सम्झौता अनुसार कर्णाली स्वास्थ्य विज्ञान प्रतिष्ठानमा चिकित्सा',
'text_position'=>'fullbanner',
'created_by'=>'1',
'verified_by'=>'1',
'img_url'=>'http://capitalnepal.test/uploads/photos/car.jpg',
'published_at'=>'2022-06-10 11:28:00',
'isBanner'=>'1',
'isSpecial'=>'1',
'isPhotofeature'=>'1',
'isFixed'=>'1',
'isBreaking'=>'1',
'breakingNewsOrder'=>'1',
'created_at'=>'2022-06-10 11:28:00',
'updated_at'=>'2022-06-10 11:28:00',
'isSpecial' => '1',
'category' => '["50"]',
'description' => json_encode($desc, JSON_UNESCAPED_UNICODE),
'title' => json_encode($title, JSON_UNESCAPED_UNICODE)
]);
}
anther one
$datas = DB::table('tbl_teams')->get();
foreach ($datas as $data){
if($data->delete_status == 0)
{
$name = array(
'en' => $data->title,
'np' =>$data->nepali_title,
);
$description=array(
'en'=>$data->description,
'np'=>$data->description_nepali,
);
$phone=$data->phone;
$email=$data->email;
$address=$data->address;
$facebook=$data->facebook;
$twitter=$data->twitter;
$status=$data->publish_status;
DB::table('teams')->insert([
'full_name' => json_encode($name, JSON_UNESCAPED_UNICODE),
'phone' => $phone,
'email' => $email,
'address' => $address,
'facebook' => $facebook,
'twitter' => $twitter,
'publish_status' =>$status,
'designation_id' => '1',
'isOlddata' => '0',
'image'=>'http://capitalnepal.test/uploads/photos/car.jpg',
'created_at'=>'2022-06-10 11:28:00',
'updated_at'=>'2022-06-10 11:28:00',
]);
}
0 Comments