0% found this document useful (0 votes)
57 views1 page

Authentication Links

This document contains code for authentication links in a navigation menu. It displays a "Login" link for unauthenticated users and a dropdown menu with the logged in user's name and a "Logout" option for authenticated users.

Uploaded by

Matias Joel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views1 page

Authentication Links

This document contains code for authentication links in a navigation menu. It displays a "Login" link for unauthenticated users and a dropdown menu with the logged in user's name and a "Logout" option for authenticated users.

Uploaded by

Matias Joel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<!

-- Authentication Links -->


@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login')
}}">{{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{
route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link
dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-
haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span
class="caret"></span>
</a>

<div class="dropdown-menu dropdown-menu-


right" 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" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest

You might also like