• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LeTraceurSnorkLibrary / MessSaga / 23788908627

31 Mar 2026 08:53AM UTC coverage: 0.549% (-18.1%) from 18.656%
23788908627

Pull #13

github

web-flow
Merge 03d4dba7f into b32c68b3f
Pull Request #13: infra: coverage only for unit-tests

4 of 729 relevant lines covered (0.55%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Http/Controllers/Auth/NewPasswordController.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Http\Controllers\Auth;
6

7
use App\Http\Controllers\Controller;
8
use Illuminate\Auth\Events\PasswordReset;
9
use Illuminate\Http\RedirectResponse;
10
use Illuminate\Http\Request;
11
use Illuminate\Support\Facades\Hash;
12
use Illuminate\Support\Facades\Password;
13
use Illuminate\Support\Str;
14
use Illuminate\Validation\Rules;
15
use Illuminate\Validation\ValidationException;
16
use Inertia\Inertia;
17
use Inertia\Response;
18

19
class NewPasswordController extends Controller
20
{
21
    /**
22
     * Display the password reset view.
23
     */
24
    public function create(Request $request): Response
25
    {
26
        return Inertia::render('Auth/ResetPassword', [
×
27
            'email' => $request->email,
×
28
            'token' => $request->route('token'),
×
29
        ]);
×
30
    }
31

32
    /**
33
     * Handle an incoming new password request.
34
     *
35
     * @throws \Illuminate\Validation\ValidationException
36
     */
37
    public function store(Request $request): RedirectResponse
38
    {
39
        $request->validate([
×
40
            'token'    => 'required',
×
41
            'email'    => 'required|email',
×
42
            'password' => ['required', 'confirmed', Rules\Password::defaults()],
×
43
        ]);
×
44

45
        // Here we will attempt to reset the user's password. If it is successful we
46
        // will update the password on an actual user model and persist it to the
47
        // database. Otherwise we will parse the error and return the response.
48
        $status = Password::reset(
×
49
            $request->only('email', 'password', 'password_confirmation', 'token'),
×
50
            function ($user) use ($request) {
×
51
                $user->forceFill([
×
52
                    'password'       => Hash::make($request->password),
×
53
                    'remember_token' => Str::random(60),
×
54
                ])->save();
×
55

56
                event(new PasswordReset($user));
×
57
            }
×
58
        );
×
59

60
        // If the password was successfully reset, we will redirect the user back to
61
        // the application's home authenticated view. If there is an error we can
62
        // redirect them back to where they came from with their error message.
63
        if ($status == Password::PASSWORD_RESET) {
×
64
            return redirect()->route('login')->with('status', __($status));
×
65
        }
66

67
        throw ValidationException::withMessages([
×
68
            'email' => [trans($status)],
×
69
        ]);
×
70
    }
71
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc