vendredi 25 septembre 2020

Laravel Localization Language Switcher using currentRouteName pass argument

I am having an issue with language switcher, when trying to execute a route with more than one parameter

I get following error message

    Missing required parameters for [Route: client.edit] [URI: {language}/client/{id}/edit].

in the header having an switcher code Route::currentRouteName()

          <ul class="dropdown-menu" role="menu">
            <li><a href="">EN</a></li>
            <li class="divider"></li>
            <li><a href="">AR</a></li>
          </ul>

I tried below code, it is not working

            <?php if(isset(request()->id)) { ?>
                <li><a href="">EN</a></li>
                <li class="divider"></li>
                <li><a href="">AR</a></li>             
            <?php } else {  ?>
            <li><a href="">EN</a></li>
            <li class="divider"></li>
            <li><a href="">AR</a></li>
            <?php } ?>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire