반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- php
- elasticSearch
- reactnative
- cartalyst
- blockchain
- 코로나19
- Tutorial
- Blade
- Java
- 이더리움
- 홈택스
- Laravel
- as후기
- Sentinel
- 인민공원
- Eclipse
- Python
- 체당금
- 당사자표시정정신청서
- win32
- 개인사업자
- 소액임금체불
- 사업자계좌
- Bootstrap
- 코로나
- auth
- 전자소송
- vue
- javascript
- 보정명령
Archives
- Today
- Total
그냥 사는 이야기
Laravel 5.3 Sentinel - Logout & show content to logged users only 본문
Development/Web
Laravel 5.3 Sentinel - Logout & show content to logged users only
없다캐라 2020. 1. 21. 10:46반응형
logout 구현
web.php
Route::post('/logout', 'LoginController@logout');
LoginController
public function logout()
{
Sentinel::logout();
return redirect('/login');
}
top.menu.php
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
@if(Sentinel::check())
<li role="presentation">
<form action="/logout" method="POST" id="logout-form">
{{ csrf_field() }}
<a href="#" onclick="document.getElementById('logout-form').submit()">Logout</a>
</form>
</li>
@else
<li role="presentation"><a href="/login">Login</a></li>
<li role="presentation"><a href="/register">Register</a></li>
@endif
</ul>
</nav>
<h3 class="text-muted">
@if(Sentinel::check())
Hello, {{ Sentinel::getUser()->first_name }}
@else
Authentication with Sentinel
@endif
</h3>
</div>
'Development > Web' 카테고리의 다른 글
Laravel 5.3 Sentinel - Restricting Access According to Roles (0) | 2020.01.21 |
---|---|
Laravel 5.3 Sentinel - Roles (0) | 2020.01.21 |
Laravel 5.3 Sentinel - Menu (0) | 2020.01.21 |
Laravel 5.3 Sentinel - Login (0) | 2020.01.21 |
Laravel 5.3 Sentinel - Create User (0) | 2020.01.20 |
Comments