enomotodev /
laractive-admin
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Enomotodev\LaractiveAdmin\Http\Controllers\Auth; |
||
| 4 | |||
| 5 | use Illuminate\Http\Request; |
||
| 6 | use App\Http\Controllers\Controller; |
||
| 7 | use Illuminate\Support\Facades\Auth; |
||
| 8 | use Illuminate\Foundation\Auth\AuthenticatesUsers; |
||
| 9 | |||
| 10 | class LoginController extends Controller |
||
| 11 | { |
||
| 12 | use AuthenticatesUsers; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | /** |
||
| 15 | * @return void |
||
| 16 | */ |
||
| 17 | 10 | public function __construct() |
|
| 18 | { |
||
| 19 | 10 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * @return \Illuminate\Http\Response |
||
| 23 | */ |
||
| 24 | 10 | public function showLoginForm() |
|
| 25 | { |
||
| 26 | 10 | return view('laractive-admin::auth.login'); |
|
|
0 ignored issues
–
show
|
|||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Log the user out of the application. |
||
| 31 | * |
||
| 32 | * @param \Illuminate\Http\Request $request |
||
| 33 | * @return \Illuminate\Http\Response |
||
| 34 | */ |
||
| 35 | 2 | public function logout(Request $request) |
|
| 36 | { |
||
| 37 | 2 | $this->guard()->logout(); |
|
| 38 | |||
| 39 | 2 | $request->session()->invalidate(); |
|
| 40 | |||
| 41 | 2 | return redirect(route('admin.login')); |
|
|
0 ignored issues
–
show
|
|||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 7 | protected function redirectTo() |
|
| 48 | { |
||
| 49 | 7 | return route('admin.dashboard.index'); |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return \Illuminate\Contracts\Auth\StatefulGuard |
||
| 54 | */ |
||
| 55 | 8 | protected function guard() |
|
| 56 | { |
||
| 57 | 8 | return Auth::guard('laractive-admin'); |
|
| 58 | } |
||
| 59 | } |
||
| 60 |