Answers for "back to same page after changing locale"

PHP
0

back to same page after changing locale

@php
    $thisUrl = url()->current().'/';
    if (app()->getlocale() == 'en') {
        $newUrl  = str_replace('/en/', '/it/', $thisUrl);
    }else{
        $newUrl  = str_replace('/it/', '/en/', $thisUrl);
    }
 @endphp
Posted by: Guest on April-17-2022

Code answers related to "back to same page after changing locale"

Browse Popular Code Answers by Language