Language Navigation

This navigation will switch between languages. When switching, you will stay on the same page but in a different language. It even works with dynamic pages where you will stay on the same entry when switching languages.

<nav>
    <ul class="flex items-center space-x-4 uppercase">
        @foreach (languages() as $language)
            <li>
                <a href="{{ page()->url($language) }}" class="{{ $language->active() ? 'font-bold' : '' }}">
                    {{ $language->slug }}
                </a>
            </li>
        @endforeach
    </ul>
</nav>
Previous topic
← Navigation
Next topic
Hero →