protected function loadLocales()
 {
     //Set the default locale as the first one.
     $currentLocale = Config::get('app.locale');
     $primaryLocale = $this->primaryLocale;
     $translatingLocale = Cookie::get($this->cookieName(self::COOKIE_TRANS_LOCALE), $currentLocale);
     $locales = Translation::groupBy('locale')->lists('locale')->all() ?: [];
     $locales = array_merge(array($primaryLocale, $translatingLocale, $currentLocale), $locales);
     return array_flatten(array_unique($locales));
 }