@php $cur = request()->attributes->get('ui_locale','ja'); $base = request()->getSchemeAndHttpHost() . request()->getBaseUrl(); // 例: https://host/mag-navi.com/public_html $path = request()->getPathInfo(); // LocalePrefixで接頭除去済み(=jaパス) $qs = request()->getQueryString(); $suffix = ($path === '/' ? '' : $path) . ($qs ? '?'.$qs : ''); $langUrls = []; foreach (array_keys(config('app.locales')) as $lc) { $langUrls[$lc] = $base . ($lc === 'ja' ? '' : '/'.$lc) . $suffix; } @endphp
@if($langUrls) @foreach(config('app.locales') as $code=>$label) $code===$cur])>{{ $label }} @endforeach @endif {{ __('口コミを書く') }} {{ __('店舗様ログイン') }} {{ __('無料掲載') }}