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

ForgotPasswordSubmitEmailController::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 2
nc 2
nop 1
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