| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 3 | public function store(Request $request) |
|
| 30 | { |
||
| 31 | 3 | $request->validate([ |
|
| 32 | 'email' => ['required', 'email'], |
||
| 33 | ]); |
||
| 34 | |||
| 35 | // We will send the password reset link to this user. Once we have attempted |
||
| 36 | // to send the link, we will examine the response then see the message we |
||
| 37 | // need to show to the user. Finally, we'll send out a proper response. |
||
| 38 | 3 | $status = Password::sendResetLink( |
|
| 39 | 3 | $request->only('email') |
|
| 40 | ); |
||
| 41 | |||
| 42 | 3 | return $status == Password::RESET_LINK_SENT |
|
| 43 | 3 | ? back()->with('status', __($status)) |
|
| 44 | : back()->withInput($request->only('email')) |
||
| 45 | 3 | ->withErrors(['email' => __($status)]); |
|
| 46 | } |
||
| 48 |