/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $generator = \Faker\Factory::create('vi_VN');
     $articleCategories = ['Thị trường nhà đất', 'Dự án căn hộ', 'Đầu tư căn hộ', 'Lời khuyên'];
     //, 'Vị trí bài viết', 'Slideshow chính', 'Trang chủ', 'Slideshow footer'];
     $articleCategoryPositionArticles = null;
     foreach ($articleCategories as $key => $value) {
         $articleCategory = ArticleCategory::create(['key' => Common::createKeyURL($value), 'parent_id' => is_null($articleCategoryPositionArticles) ? 0 : $articleCategoryPositionArticles->id, 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
         ArticleCategoryTranslation::create(['article_category_id' => $articleCategory->id, 'locale' => 'vi', 'name' => $value, 'summary' => $value, 'meta_description' => $value, 'meta_keywords' => $value]);
         if ($value == 'Vị trí bài viết') {
             $articleCategoryPositionArticles = $articleCategory;
         }
     }
     $articles = ['Giới Thiệu', 'Tuyển Dụng', 'Tài Khoản Giao Dịch'];
     foreach ($articles as $key => $value) {
         $article = Article::create(['key' => Common::createKeyURL($value), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
         ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $value, 'summary' => $generator->text($maxNbChars = 200), 'content' => $generator->realText($maxNbChars = 1000, $indexSize = 2), 'meta_description' => $generator->text($maxNbChars = 200), 'meta_keywords' => $generator->text($maxNbChars = 200)]);
     }
     $categories = ArticleCategory::where('parent_id', '=', 0)->lists('id');
     $categories2 = ArticleCategory::where('parent_id', '<>', 0)->lists('id');
     for ($i = 0; $i < 3; $i++) {
         $name = $generator->sentence($nbWords = 6);
         $key = Common::createKeyURL($name);
         $article = Article::create(['key' => $key, 'priority' => $i, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
         ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $generator->text($maxNbChars = 200), 'content' => $generator->text, 'meta_description' => $generator->text($maxNbChars = 200), 'meta_keywords' => $generator->text($maxNbChars = 200)]);
         Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/uploads/notfound.jpg', 'priority' => 0, 'is_publish' => 1]);
         $article->categories()->attach($categories->random());
         //$article->categories()->attach($categories2->random());
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $generator = \Faker\Factory::create('vi_VN');
     $articleCategories = ['Thông tin', 'Bài viết nỗi bật'];
     foreach ($articleCategories as $key => $value) {
         $articleCategory = ArticleCategory::create(['key' => Common::createKeyURL($value), 'parent_id' => 0, 'priority' => 0, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
         ArticleCategoryTranslation::create(['article_category_id' => $articleCategory->id, 'locale' => 'vi', 'name' => $value, 'summary' => $value, 'meta_description' => $value, 'meta_keywords' => $value]);
     }
     $articles = ['Giới thiệu', 'Dịch vụ của chúng tôi', 'Tại sao chọn chúng tôi'];
     foreach ($articles as $key => $item) {
         $article = Article::create(['key' => Common::createKeyURL($item), 'priority' => 0, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
         ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $item, 'summary' => $generator->text($maxNbChars = 200), 'content' => $generator->text, 'meta_description' => $generator->text($maxNbChars = 200), 'meta_keywords' => $generator->text($maxNbChars = 200)]);
         Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/uploads/notfound.jpg', 'priority' => 0, 'is_publish' => 1]);
     }
     // BÀI VIẾT THÔNG TIN
     $articleCategory = ArticleCategory::findByKey('thong-tin')->first()->id;
     if (!is_null($articleCategory) && count($articleCategory) > 0) {
         for ($i = 0; $i < 10; $i++) {
             $name = $generator->sentence($nbWords = 6);
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => 0, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $generator->text($maxNbChars = 200), 'content' => $generator->text, 'meta_description' => $generator->text($maxNbChars = 200), 'meta_keywords' => $generator->text($maxNbChars = 200)]);
             /*
             Attachment::create([
             	'entry_id' => $article->id,
             	'table_name' => 'articles',
             	//'path' => $generator->imageUrl($width = 780, $height = 546),
             	'path' => '/uploads/notfound.jpg',
             	'priority' => 0,
             	'is_publish' => 1
             ]);
             */
             $article->categories()->attach($articleCategory);
         }
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $generator = \Faker\Factory::create('vi_VN');
     $name = 'Giới thiệu';
     $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => 0, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
     ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $generator->text($maxNbChars = 200), 'content' => $generator->text, 'meta_description' => $generator->text($maxNbChars = 200), 'meta_keywords' => $generator->text($maxNbChars = 200)]);
     Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/uploads/notfound.jpg', 'priority' => 0, 'is_publish' => 1]);
 }
 /**
  * Test the localized model.
  */
 public function testLocales()
 {
     $locales = ['en', 'nl', 'fr', 'de'];
     $this->visit('/create')->see('Article created');
     $this->assertCount(1, Article::all());
     $this->assertCount(count($locales), ArticleTranslation::all());
     foreach ($locales as $locale) {
         $this->visit("/{$locale}")->see("Title {$locale}")->see("Text {$locale}");
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $generator = \Faker\Factory::create('vi_VN');
     $articleCategories = ['Trang chủ', 'Về chúng tôi', 'Dịch vụ thuê email server', 'Dịch vụ Máy chủ', 'Dịch vụ Hosting', 'Dịch vụ Tên Miền', 'Dịch vụ CDN', 'Dịch vụ Website', 'Bảng giá', 'Thông tin', 'Hỗ trợ', 'Liên hệ', 'LandingPage'];
     foreach ($articleCategories as $key => $value) {
         $articleCategory = ArticleCategory::create(['key' => Common::createKeyURL($value), 'parent_id' => 0, 'priority' => 0, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
         ArticleCategoryTranslation::create(['article_category_id' => $articleCategory->id, 'locale' => 'vi', 'name' => $value, 'summary' => $value, 'meta_description' => $value, 'meta_keywords' => $value]);
     }
     // BÀI VIẾT NỘI DUNG TRANG CHỦ
     $articleCategories_homepage = ArticleCategory::findByKey('trang-chu')->first()->id;
     if (!is_null($articleCategories_homepage) && count($articleCategories_homepage) > 0) {
         $homepage_articles_name = ['Đăng ký hợp tác', 'Dịch vụ của chúng tôi', 'Trung tâm hỗ trợ khách hàng Cloudmedia', 'Hostings', 'Tại sao nên chọn chúng tôi', 'Cam kết dịch vụ', 'Nhận xét của khách hàng'];
         $homepage_articles_summary = ['Mô tả đăng ký hợp tác', 'Mô tả Dịch vụ của chúng tôi', 'Hãy chọn kênh hỗ trợ thuận tiện cho bạn nhất', 'Phù hợp với mọi cá nhân và doanh nghiệp', 'Tại sao nên chọn chúng tôi', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng', 'Hãy xem họ nói gì về chúng tôi'];
         $homepage_articles_content_templates = ['home_page_dang-ky-hop-tac.html', 'home_page_dich-vu-cua-chung-toi.html', 'home_page_trung-tam-ho-tro-khach-hang-Cloudmedia.html', 'home_page_hostings.html', 'home_page_tai-sao-nen-chon-chung-toi.html', 'home_page_cam-ket-dich-vu.html', 'home_page_nhan-xet-cua-khach-hang.html'];
         foreach ($homepage_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $homepage_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $homepage_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($articleCategories_homepage);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ MÁY CHỦ (Cloud VPS)
     $vps_service_articleCategories = ArticleCategory::findByKey('dich-vu-may-chu')->first()->id;
     if (!is_null($vps_service_articleCategories) && count($vps_service_articleCategories) > 0) {
         $vps_service_articles_name = ['Lựa chọn thông minh', 'Tính năng VPS nổi bật', 'VPS Sự Khác Biệt', 'Các gói tiêu biểu VPS', 'Cam kết dịch vụ VPS'];
         $vps_service_articles_summary = ['Trở thành đối tác của chúng tôi và cùng thành công!', 'Cloud VPS Cloudmedia cung cấp với nhiều tính năng nổi bật', 'Điều làm Cloudmedia trở thành sự lựa chọn thông minh của bạn?', 'Phù hợp với mọi cá nhân và doanh nghiệp', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $vps_service_articles_content_templates = ['vps_service_lua-chon-thong-minh.html', 'vps_service_tinh-nang-vps-noi-bat.html', 'vps_service_su-khac-biet.html', 'vps_service_cac-goi-tieu-bieu-vps.html', 'vps_service_cam-ket-dich-vu.html'];
         foreach ($vps_service_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $vps_service_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $vps_service_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($vps_service_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ MÁY CHỦ (Cloud VPS) LANDING PAGE
     $vps_landingpage_articleCategories = ArticleCategory::findByKey('landingpage')->first()->id;
     if (!is_null($vps_landingpage_articleCategories) && count($vps_landingpage_articleCategories) > 0) {
         $vps_landingpage_articles_name = ['Lựa chọn thông minh LandingPage', 'Tính năng VPS nổi bật tại CloudMedia', 'VPS Sự Khác Biệt LandingPage', 'Các gói VPS của CloudMedia', 'CloudMedia cam kết dịch vụ VPS'];
         $vps_landingpage_articles_summary = ['Trở thành đối tác của chúng tôi và cùng thành công!', 'Cloud VPS Cloudmedia cung cấp với nhiều tính năng nổi bật', 'Điều làm Cloudmedia trở thành sự lựa chọn thông minh của bạn?', 'Phù hợp với mọi cá nhân và doanh nghiệp', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $vps_landingpage_articles_content_templates = ['vps_service_lua-chon-thong-minh-landingpage.html', 'vps_service_tinh-nang-vps-noi-bat-landingpage.html', 'vps_service_su-khac-biet-landingpage.html', 'vps_service_cac-goi-tieu-bieu-vps-landingpage.html', 'vps_service_cam-ket-dich-vu-landingpage.html'];
         foreach ($vps_landingpage_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $vps_landingpage_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $vps_landingpage_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($vps_landingpage_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ EMAIL SERVER
     $email_server_articleCategories = ArticleCategory::findByKey('dich-vu-thue-email-server')->first()->id;
     if (!is_null($email_server_articleCategories) && count($email_server_articleCategories) > 0) {
         $email_server_articles_name = ['Tính năng email server nổi bật', 'Gói email server tiêu biểu', 'Email server Sự Khác Biệt', 'Cam kết dịch vụ email server'];
         $email_server_articles_summary = ['Mô tả Tính năng email server nổi bật', 'Mô tả Các gói email server tiêu biểu', 'Sự Khác Biệt', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $email_server_articles_content_templates = ['email_server_tinh-nang-email-server-noi-bat.html', 'email_server_goi-email-server-tieu-bieu.html', 'email_server_su-khac-biet.html', 'email_server_cam-ket-dich-vu-email-server.html'];
         foreach ($email_server_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $email_server_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $email_server_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($email_server_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ HOSTING
     $hosting_service_articleCategories = ArticleCategory::findByKey('dich-vu-hosting')->first()->id;
     if (!is_null($hosting_service_articleCategories) && count($hosting_service_articleCategories) > 0) {
         $hosting_service_articles_name = ['Gói hosting tiêu biểu', 'Hosting Sự Khác Biệt', 'Cam kết dịch vụ hosting'];
         $hosting_service_articles_summary = ['Mô tả Các gói hosting tiêu biểu', 'Sự Khác Biệt', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $hosting_service_articles_content_templates = ['hosting_service_goi-hosting-tieu-bieu.html', 'hosting_service_tinh-nang-hosting-noi-bat.html', 'hosting_service_cam-ket-dich-vu-hosting.html'];
         foreach ($hosting_service_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $hosting_service_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $hosting_service_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($hosting_service_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ DOMAIN
     $domain_service_articleCategories = ArticleCategory::findByKey('dich-vu-ten-mien')->first()->id;
     if (!is_null($domain_service_articleCategories) && count($domain_service_articleCategories) > 0) {
         $domain_service_articles_name = ['Tính năng domain nổi bật', 'Gói domain tiêu biểu', 'Domain Sự Khác Biệt', 'Cam kết dịch vụ domain'];
         $domain_service_articles_summary = ['Mô tả Tính năng domain nổi bật', 'Mô tả Các gói domain tiêu biểu', 'Sự Khác Biệt', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $domain_service_articles_content_templates = ['domain_service_tinh-nang-domain-noi-bat.html', 'domain_service_goi-domain-tieu-bieu.html', 'domain_service_su-khac-biet.html', 'domain_service_cam-ket-dich-vu-domain.html'];
         foreach ($domain_service_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $domain_service_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $domain_service_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($domain_service_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ CDN
     $cdn_service_articleCategories = ArticleCategory::findByKey('dich-vu-cdn')->first()->id;
     if (!is_null($cdn_service_articleCategories) && count($cdn_service_articleCategories) > 0) {
         $cdn_service_articles_name = ['Tính năng CDN nổi bật', 'Gói CDN tiêu biểu', 'CDN Sự Khác Biệt', 'Cam kết dịch vụ CDN'];
         $cdn_service_articles_summary = ['Mô tả Tính năng cdn nổi bật', 'Mô tả Các gói cdn tiêu biểu', 'Sự Khác Biệt', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $cdn_service_articles_content_templates = ['cdn_service_tinh-nang-cdn-noi-bat.html', 'cdn_service_goi-cdn-tieu-bieu.html', 'cdn_service_tinh-nang-cdn-noi-bat.html', 'cdn_service_cam-ket-dich-vu-cdn.html'];
         foreach ($cdn_service_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $cdn_service_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $cdn_service_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($cdn_service_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG DỊCH VỤ WEBSITE
     $website_service_articleCategories = ArticleCategory::findByKey('dich-vu-website')->first()->id;
     if (!is_null($website_service_articleCategories) && count($website_service_articleCategories) > 0) {
         $website_service_articles_name = ['Tính năng website nổi bật', 'Gói website tiêu biểu', 'Website Sự Khác Biệt', 'Cam kết dịch vụ website'];
         $website_service_articles_summary = ['Mô tả Tính năng website nổi bật', 'Mô tả Các gói website tiêu biểu', 'Sự Khác Biệt', 'Chúng tôi có những tiêu chuẩn khắt khe khi đưa dịch vụ đến tay khách hàng'];
         $website_service_articles_content_templates = ['website_service_tinh-nang-website-noi-bat.html', 'website_service_goi-website-tieu-bieu.html', 'website_service_su-khac-biet.html', 'website_service_cam-ket-dich-vu-website.html'];
         foreach ($website_service_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $website_service_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $website_service_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($website_service_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG BẢNG GIÁ DỊCH VỤ
     $pricing_articleCategories = ArticleCategory::findByKey('bang-gia')->first()->id;
     if (!is_null($pricing_articleCategories) && count($pricing_articleCategories) > 0) {
         $pricing_articles_name = ['Bảng giá thuê email server', 'Bảng giá SSD Cloud VPS', 'Bảng giá hosting', 'Bảng giá tên miền', 'Bảng giá CDN', 'Bảng giá website'];
         $pricing_articles_summary = ['Bảng giá thuê email server', 'Bảng giá SSD Cloud VPS', 'Bảng giá hosting', 'Bảng giá tên miền', 'Bảng giá CDN', 'Bảng giá website'];
         $pricing_articles_content_templates = ['pricing_bang-gia-thue-email-server.html', 'pricing_bang-gia-ssd-cloud-vps.html', 'pricing_bang-gia-hosting.html', 'pricing_bang-gia-ten-mien.html', 'pricing_bang-gia-cdn.html', 'pricing_bang-gia-website.html'];
         foreach ($pricing_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $pricing_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $pricing_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($pricing_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG HỖ TRỢ
     $support_articleCategories = ArticleCategory::findByKey('ho-tro')->first()->id;
     if (!is_null($support_articleCategories) && count($support_articleCategories) > 0) {
         $support_articles_name = ['Trung tâm hỗ trợ khách hàng', 'Tài liêu hướng dẫn', 'Những câu hỏi thường gặp'];
         $support_articles_summary = ['Trung tâm hỗ trợ khách hàng', 'Tài liêu hướng dẫn', 'Những câu hỏi thường gặp'];
         $support_articles_content_templates = ['support_trung-tam-ho-tro-khach-hang.html', 'support_tai-lieu-huong-dan.html', 'support_nhung-cau-hoi-thuong-gap.html'];
         foreach ($support_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $support_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $support_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($support_articleCategories);
         }
     }
     // BÀI VIẾT NỘI DUNG TRANG LIÊN HỆ
     $contact_articleCategories = ArticleCategory::findByKey('lien-he')->first()->id;
     if (!is_null($contact_articleCategories) && count($contact_articleCategories) > 0) {
         $contact_articles_name = ['Thông tin liên hệ Cloudmedia', 'Chi tiết thông tin liên hệ Cloudmedia'];
         $contact_articles_summary = ['Thông tin liên hệ Cloudmedia', 'Bạn có thể đến trực tiếp văn phòng, gọi điện thoại hoặc gửi email để liên hệ với chúng tôi'];
         $contact_articles_content_templates = ['contact_thong-tin-lien-he-Cloudmedia.html', 'contact_chi-tiet-thong-tin-lien-he-Cloudmedia.html'];
         foreach ($contact_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $contact_articles_summary[$key], 'content' => file_get_contents(base_path() . '\\public\\templates\\articles\\' . $contact_articles_content_templates[$key]), 'meta_description' => $name, 'meta_keywords' => $name]);
             $article->categories()->attach($contact_articleCategories);
         }
     }
     // BÀI VIẾT TRONG 'VỀ CHÚNG TÔI'
     $about_us_articleCategories = ArticleCategory::findByKey('ve-chung-toi')->first()->id;
     if (!is_null($about_us_articleCategories) && count($about_us_articleCategories) > 0) {
         $about_us_articles_name = ['Cloudmedia', 'Đối tác kinh doanh', 'Quy định dịch vụ', 'Bảo mật thông tin', 'Báo cáo lạm dụng'];
         $about_us_articles_summary = ['Giới thiệu Cloudmedia ngắn gọn', 'Đối tác kinh doanh', 'Quy định dịch vụ', 'Bảo mật thông tin', 'Báo cáo lạm dụng'];
         $about_us_articles_content = ['Cloudmedia là một dịch vụ của Công Ty TNHH Công Nghệ Cloudmedia,với sứ mệnh cung cấp cho cộng đồng webmaster Việt Nam một dịch vụ Cloud Hosting tân tiến và chất lượng nhất.', 'Đối tác kinh doanh', 'Nội dung quy định dịch vụ', 'Nội dung bảo mật thông tin', 'Nội dung báo cáo lạm dụng'];
         foreach ($about_us_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $about_us_articles_summary[$key], 'content' => $about_us_articles_content[$key], 'meta_description' => $name, 'meta_keywords' => $name]);
             Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/frontend/img/background-' . ($key + 14) . '.jpg', 'priority' => 0, 'is_publish' => 1]);
             $article->categories()->attach($about_us_articleCategories);
         }
     }
     // BÀI VIẾT TRONG TRANG THÔNG TIN
     $info_articleCategories = ArticleCategory::findByKey('thong-tin')->first()->id;
     if (!is_null($info_articleCategories) && count($info_articleCategories) > 0) {
         $info_articles_name = ['Thông tin 1', 'Thông tin 2'];
         $info_articles_summary = ['Mô tả Thông tin 1', 'Mô tả Thông tin 2'];
         $info_articles_content = ['Nội dung Thông tin 1', 'Nội dung Thông tin 2'];
         foreach ($info_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $info_articles_summary[$key], 'content' => $info_articles_content[$key], 'meta_description' => $name, 'meta_keywords' => $name]);
             Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/frontend/img/background-' . ($key + 10) . '.jpg', 'priority' => 0, 'is_publish' => 1]);
             $article->categories()->attach($info_articleCategories);
         }
     }
     //DANH MỤC BÀI VIẾT CON CỦA DANH MỤC "THÔNG TIN"
     if (!is_null($info_articleCategories) && count($info_articleCategories) > 0) {
         $sub_article_categories = ['Thông tin công nghệ', 'Hỗ trợ kỹ thuật', 'Tuyển dụng', 'Bài viết nổi bật'];
         foreach ($sub_article_categories as $key => $value) {
             $articleCategory = ArticleCategory::create(['key' => Common::createKeyURL($value), 'parent_id' => $info_articleCategories, 'priority' => $key, 'is_publish' => 1, 'created_by' => 'phantsang', 'updated_by' => 'phantsang']);
             ArticleCategoryTranslation::create(['article_category_id' => $articleCategory->id, 'locale' => 'vi', 'name' => $value, 'summary' => $value, 'meta_description' => $value, 'meta_keywords' => $value]);
         }
     }
     // BÀI VIẾT TRONG DANH MỤC "BÀI VIẾT NỔI BẬT"
     $popular_articleCategories = ArticleCategory::findByKey('bai-viet-noi-bat')->first()->id;
     if (!is_null($popular_articleCategories) && count($popular_articleCategories) > 0) {
         $popular_articles_name = ['Bài viết nổi bật 1', 'Bài viết nổi bật 2', 'Bài viết nổi bật 3', 'Bài viết nổi bật 4', 'Bài viết nổi bật 5'];
         $popular_articles_summary = ['Tóm tắt bài viêt nổi bật 1', 'Tóm tắt bài viêt nổi bật 2', 'Tóm tắt bài viêt nổi bật 3', 'Tóm tắt bài viêt nổi bật 4', 'Tóm tắt bài viêt nổi bật 5'];
         $popular_articles_content = ['Nội dung bài viêt nổi bật 1', 'Nội dung bài viêt nổi bật 2', 'Nội dung bài viêt nổi bật 3', 'Nội dung bài viêt nổi bật 4', 'Nội dung bài viêt nổi bật 5'];
         foreach ($popular_articles_name as $key => $name) {
             $article = Article::create(['key' => Common::createKeyURL($name), 'priority' => $key, 'is_publish' => 1, 'created_by' => 'vankhoektcn', 'updated_by' => 'vankhoektcn']);
             ArticleTranslation::create(['article_id' => $article->id, 'locale' => 'vi', 'name' => $name, 'summary' => $popular_articles_summary[$key], 'content' => $popular_articles_content[$key], 'meta_description' => $name, 'meta_keywords' => $name]);
             Attachment::create(['entry_id' => $article->id, 'table_name' => 'articles', 'path' => '/frontend/img/background-' . ($key + 1) . '.jpg', 'priority' => 0, 'is_publish' => 1]);
             $article->categories()->attach($popular_articleCategories);
         }
     }
 }