LoginController   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 48
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A redirectTo() 0 3 1
A logout() 0 7 1
A showLoginForm() 0 3 1
A guard() 0 3 1
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
The trait Illuminate\Foundation\Auth\AuthenticatesUsers requires some properties which are not provided by Enomotodev\LaractiveAdmi...rs\Auth\LoginController: $redirectTo, $maxAttempts, $decayMinutes
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
Bug Best Practice introduced by
The expression return view('laractive-admin::auth.login') returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
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
Bug Best Practice introduced by
The expression return redirect(route('admin.login')) returns the type Illuminate\Http\RedirectResponse which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
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