1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Backpack\CRUD\app\Http\Controllers\Auth; |
4
|
|
|
|
5
|
|
|
use App\Http\Requests\Request; |
|
|
|
|
6
|
|
|
use Illuminate\Routing\Controller; |
7
|
|
|
use Illuminate\Foundation\Auth\EmailVerificationRequest; |
8
|
|
|
use Prologue\Alerts\Facades\Alert; |
9
|
|
|
|
10
|
|
|
class VerifyEmailController extends Controller |
11
|
|
|
{ |
12
|
|
|
public null|string $redirectTo = null; |
13
|
|
|
/** |
14
|
|
|
* Create a new controller instance. |
15
|
|
|
* |
16
|
|
|
* @return void |
17
|
|
|
*/ |
18
|
|
|
public function __construct() |
19
|
|
|
{ |
20
|
|
|
$this->middleware(backpack_middleware()); |
21
|
|
|
$this->middleware('signed')->only('verifyEmail'); |
22
|
|
|
$this->middleware('throttle:6,1')->only('resendVerificationEmail'); |
23
|
|
|
|
24
|
|
|
if (! backpack_users_have_email()) { |
25
|
|
|
abort(501, trans('backpack::base.no_email_column')); |
26
|
|
|
} |
27
|
|
|
// where to redirect after the email is verified |
28
|
|
|
$this->redirectTo = property_exists($this, 'redirectTo') && $this->redirectTo ? $this->redirectTo : backpack_url('dashboard'); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function emailVerificationRequired() |
32
|
|
|
{ |
33
|
|
|
return view(backpack_view('auth.verify-email')); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Verify the user's email address. |
38
|
|
|
* |
39
|
|
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
40
|
|
|
*/ |
41
|
|
|
public function verifyEmail(EmailVerificationRequest $request) |
42
|
|
|
{ |
43
|
|
|
$request->fulfill(); |
44
|
|
|
|
45
|
|
|
return redirect($this->redirectTo); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Resend the email verification notification. |
50
|
|
|
*/ |
51
|
|
|
public function resendVerificationEmail(Request $request) : \Illuminate\Http\RedirectResponse |
52
|
|
|
{ |
53
|
|
|
$request->user(backpack_guard_name())->sendEmailVerificationNotification(); |
54
|
|
|
|
55
|
|
|
Alert::success('Email verification link sent successfully.')->flash(); |
56
|
|
|
|
57
|
|
|
return back()->with('status', 'verification-link-sent'); |
58
|
|
|
} |
59
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths