Test Failed
Push — dev6 ( e3f62b...d58043 )
by Ron
17:13
created

ForgotPasswordSubmitEmailController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 2
1
<?php
2
3
namespace App\Http\Controllers\Auth;
4
5
use Illuminate\Support\Facades\Password;
6
7
use App\Http\Controllers\Controller;
8
use App\Http\Requests\Auth\ForgotPasswordEmailRequest;
9
use Illuminate\Support\Facades\Log;
10
11
class ForgotPasswordSubmitEmailController extends Controller
12
{
13
    /**
14
     *  Send the user an email with a link to reset their password
15
     */
16
    public function __invoke(ForgotPasswordEmailRequest $request)
17
    {
18
        $status = Password::sendResetLink($request->only('email'));
19
20
        return $status === Password::RESET_LINK_SENT ?
21
            back()->with([
22
                'message' => $status,
23
                'type' => 'success'
24
            ]) : back()->withErrors(['email' => $status]);
25
    }
26
}
27