Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — add-email-confirmation ( f75314...e4f74e )
by Pedro
21:53 queued 20:48
created

VerifyEmailController::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 3
eloc 6
c 1
b 0
f 1
nc 4
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\Http\Controllers\Auth;
4
5
use Backpack\CRUD\app\Http\Requests\EmailVerificationRequest;
6
use Illuminate\Http\Request;
7
use Illuminate\Routing\Controller;
8
use Prologue\Alerts\Facades\Alert;
9
10
class VerifyEmailController extends Controller
11
{
12
    public null|string $redirectTo = null;
13
14
    /**
15
     * Create a new controller instance.
16
     *
17
     * @return void
18
     */
19
    public function __construct()
20
    {
21
        $this->middleware(backpack_middleware());
22
        $this->middleware('signed')->only('verifyEmail');
23
        $this->middleware('throttle:'.config('backpack.base.email_verification_throttle_access'))->only('resendVerificationEmail');
24
25
        if (! backpack_users_have_email()) {
26
            abort(500, trans('backpack::base.no_email_column'));
27
        }
28
        // where to redirect after the email is verified
29
        $this->redirectTo = $this->redirectTo !== null ? $this->redirectTo : backpack_url('dashboard');
30
    }
31
32
    public function emailVerificationRequired(): \Illuminate\Contracts\View\View
33
    {
34
        return view(backpack_view('auth.verify-email'));
35
    }
36
37
    /**
38
     * Verify the user's email address.
39
     *
40
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
41
     */
42
    public function verifyEmail(EmailVerificationRequest $request)
43
    {
44
        $request->fulfill();
45
46
        return redirect($this->redirectTo);
47
    }
48
49
    /**
50
     * Resend the email verification notification.
51
     */
52
    public function resendVerificationEmail(Request $request): \Illuminate\Http\RedirectResponse
53
    {
54
        $request->user(backpack_guard_name())->sendEmailVerificationNotification();
55
56
        Alert::success('Email verification link sent successfully.')->flash();
57
58
        return back()->with('status', 'verification-link-sent');
59
    }
60
}
61