반응형
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 |
Tags
- 개인사업자
- blockchain
- cartalyst
- php
- as후기
- Tutorial
- auth
- Blade
- Sentinel
- elasticSearch
- 홈택스
- 코로나19
- win32
- 인민공원
- Bootstrap
- 당사자표시정정신청서
- 코로나
- Java
- 전자소송
- Eclipse
- 보정명령
- reactnative
- 소액임금체불
- Laravel
- Python
- 체당금
- 이더리움
- 사업자계좌
- 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