Passed
Branch master (64a50e)
by Brian
02:57
created

ConfirmPasswordController::showConfirmForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Http\Controllers\Admin\Auth;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Foundation\Auth\ConfirmsPasswords;
7
use Illuminate\Http\Request;
8
9
class ConfirmPasswordController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Confirm Password Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller is responsible for handling password confirmations and
17
    | uses a simple trait to include the behavior. You're free to explore
18
    | this trait and override any functions that require customization.
19
    |
20
    */
21
22
    use ConfirmsPasswords;
23
24
    /**
25
     * Where to redirect users when the intended url fails.
26
     *
27
     * @var string
28
     */
29
    protected $redirectTo = '/admin';
30
31
    /**
32
     * Create a new controller instance.
33
     */
34 3
    public function __construct()
35
    {
36 3
        $this->middleware('admin.auth');
37
    }
38
39
    /**
40
     * Display the password confirmation view.
41
     *
42
     * @return \Illuminate\Http\Response
43
     */
44 1
    public function showConfirmForm()
45
    {
46 1
        return view('admin.auth.passwords.confirm');
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('admin.auth.passwords.confirm') returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
47
    }
48
49
    /**
50
     * Reset the password confirmation timeout.
51
     */
52 1
    protected function resetPasswordConfirmationTimeout(Request $request)
53
    {
54 1
        $request->session()->put('admin.auth.password_confirmed_at', time());
55
    }
56
57
    /**
58
     * Get the password confirmation validation rules.
59
     *
60
     * @return array
61
     */
62 2
    protected function rules()
63
    {
64
        return [
65 2
            'password' => 'required|password:admin',
66
        ];
67
    }
68
}
69