Пример #1
0
 /**
  * Bind data to the view.
  *
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with(['localized' => $this->repository->isLocalized(), 'currentLocale' => app()->getLocale(), 'availableLocales' => $this->repository->getAvailable()]);
 }
Пример #2
0
 /**
  * @param \Illuminate\Http\Request $request
  * @return string
  */
 protected function getRequestLocale($request)
 {
     $locales = array_unique(array_merge([$this->repository->getDefault()], $this->repository->getAvailable()));
     return $request->getPreferredLanguage($locales);
 }