title: Laravel 5.x: How to replace locale in URL in view/blade?
body: <p>I've a blade in my views, which looks like this:</p>
  
  <pre><code>@if (App::getLocale() == 'de')
      &lt;a href="/en/dashboard"&gt;
          &lt;i class="fa fa-language"&gt;ENGLISH&lt;/i&gt;
      &lt;/a&gt;
  @elseif (App::getLocale() == 'en')
      &lt;a href="/de/dashboard"&gt;
          &lt;i class="fa fa-language"&gt;GERMAN&lt;/i&gt;
      &lt;/a&gt;
  @endif
  </code></pre>
  
  <p>This creates a button, which allows me to switch to the other language.</p>
  
  <p>Well... The URL could also be one of these:</p>
  
  <pre><code>/en/settings
  /en/logbook
  </code></pre>
  
  <p>I want, that the button redirects to the same page, but on a different language:</p>
  
  <ul>
  <li>/en/dashboard -> /de/dashboard</li>
  <li>/en/settings -> /de/settings</li>
  <li>/en/logbook -> /de/logbook</li>
  </ul>
  
  <p>Using <code>{{ Request::url() }}</code> I'm able to get the current URL, but what's now the best way / solution to use this URL just with a different locale?</p>
  
  <p><code>{{ Request::url() }}</code> for example contains <code>/en/dashboard</code> and I would now need <code>/de/dashboard</code>.</p>
  
  <p>Does there any Laravel function exist or do I need to code this with PHP within... The blade?</p>