skip to Main Content

here is the nav bar but the code is :

@else

                            <a id="navbarDropdown" class="nav-element" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                {{ Auth::user()->name }}
                            </a>
                            <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                                <a class="dropdown-item" href="{{ route('logout') }}"
                                   onclick="event.preventDefault();document.getElementById('logout-form').submit();">
                                    {{ __('Logout') }} 
                                </a>

                                <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
                                    @csrf
                                </form>
                            </div>
                        </li>
                    @endguest  

i can’t logout

{{ __(‘Logout’) }}

this div don’t showed

2

Answers


  1. I don’t think you could use {{ __(‘Logout’) }} as is. You may use {{ $Logout }} instead. To indicate that it came from a function in your file.

    Login or Signup to reply.
  2. The code you pasted here is coming under @guest. So it will not show up if you are logged in. There will be a menu in your code for authenticated users add logout there

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search