Passed
Pull Request — 2.x (#597)
by Antonio Carlos
05:31
created

ForgotPasswordController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 2
rs 10
1
<?php
2
3
namespace A17\Twill\Http\Controllers\Admin;
4
5
use Illuminate\Auth\Passwords\PasswordBrokerManager;
6
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7
use Illuminate\View\Factory as ViewFactory;
8
9
class ForgotPasswordController extends Controller
10
{
11
    /*
12
    |--------------------------------------------------------------------------
13
    | Password Reset Controller
14
    |--------------------------------------------------------------------------
15
    |
16
    | This controller is responsible for handling password reset emails and
17
    | includes a trait which assists in sending these notifications from
18
    | your application to your users. Feel free to explore this trait.
19
    |
20
     */
21
22
    use SendsPasswordResetEmails;
23
24
    /**
25
     * @var PasswordBrokerManager
26
     */
27
    protected $passwordBrokerManager;
28
29
    public function __construct(PasswordBrokerManager $passwordBrokerManager)
30
    {
31
        parent::__construct();
32
33
        $this->passwordBrokerManager = $passwordBrokerManager;
34
        $this->middleware('twill_guest');
35
    }
36
37
    /**
38
     * @return \Illuminate\Contracts\Auth\PasswordBroker
39
     */
40
    public function broker()
41
    {
42
        return $this->passwordBrokerManager->broker('twill_users');
43
    }
44
45
    /**
46
     * @param ViewFactory $viewFactory
47
     * @return \Illuminate\Contracts\View\View
48
     */
49
    public function showLinkRequestForm(ViewFactory $viewFactory)
50
    {
51
        return $viewFactory->make('twill::auth.passwords.email');
52
    }
53
}
54