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

ForgotPasswordController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 43
ccs 0
cts 13
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A showLinkRequestForm() 0 3 1
A __construct() 0 6 1
A broker() 0 3 1
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