Reputation: 15
I can not get out of my application, I'm using the auth out of box login for laravel 5, but when I get out of my account, I'm not successful.
EDIT: the problem is that dropdown menu does not open for me to logout.
Can someone help me ?
this is my app.blade.php ->
@guest
<li><a href="{{ route('login') }}">Login</a></li>
<li><a href="{{ route('register') }}">Register</a></li>
@else
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
Logout
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
</li>
</ul>
</li>
@endguest
Upvotes: 1
Views: 2505
Reputation: 2540
Adding app.js
file helped me to open the dropdown
//app.blade.php
<script src="{{ asset('js/app.js') }}"></script>
Upvotes: 1
Reputation:
@theFlash So CSS is setting the logout button to style="display: none"
you need to set this to either display: block;
, display: inline-block;
or display: inline;
to get it to show up. At the moment it's hidden by CSS so you can't click it...
Upvotes: 1