Пример #1
0
 public function translation($language = null)
 {
     if ($language == null) {
         $language = App::getLocale();
     }
     return $this->hasMany('App\\CategoryTranslation')->where('language_id', '=', $language);
 }
Пример #2
0
 public function translationCompanyInformation($language = null)
 {
     if ($language == null) {
         $language = App::getLocale();
     }
     if ($language == 'kh') {
         return $this->getAttribute('company_information_kh');
     } elseif ($language == 'ch') {
         return $this->getAttribute('company_information_ch');
     } else {
         return $this->getAttribute('company_information');
     }
 }
Пример #3
0
 public function getInfo($page_name)
 {
     // $get_current_lang_id = Lang::getCurrentLangId();
     $current_lang_name = App::getLocale();
     return Page::where('name', '=', $page_name)->first()->langs->getByName($current_lang_name)->pageInfo();
 }
Пример #4
0
 public function getCurrentLangId()
 {
     $lang_code_name = App::getLocale();
     return Lang::getByName($lang_code_name)->id;
 }