Home > OS >  why logout don't show and i creat it with bootstrap auth in laravel?
why logout don't show and i creat it with bootstrap auth in laravel?

Time:01-27

here is the nav bar but the code is :

@else

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

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

i can't logout

{{ __('Logout') }} this div don't showed

CodePudding user response:

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.

CodePudding user response:

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

  • Related