protected function parseLocaleUriAction($uri, $action) { if (!is_array($action)) { $action = ['uses' => $action]; } $action['base_localization'] = $uri; $action['locales'] = array_merge($this->getLastGroupLocales(), $this->getActionLocales($action)); $isAvailable = in_array($this->localizer->getLocale(), $action['locales']) || in_array('all', $action['locales']); if ($isAvailable) { if (!$this->localizer->isMain() || $this->localizer->isPrefixingMain()) { $uri = array_search($this->localizer->getLocale(), $this->localizer->getAvailable()) . '/' . $uri; } } else { // If current locale is not available for this route, uri must be // hidden for this request. $uri = md5($uri); } $uri = rtrim($uri, '/'); return compact('uri', 'action'); }