1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Http\Controllers\Auth; |
4
|
|
|
|
5
|
|
|
use App\Http\Controllers\Controller; |
6
|
|
|
use App\Providers\RouteServiceProvider; |
7
|
|
|
use Illuminate\Foundation\Auth\VerifiesEmails; |
8
|
|
|
use Illuminate\Http\Request; |
9
|
|
|
use Illuminate\Support\Facades\Auth; |
10
|
|
|
|
11
|
|
|
class VerificationController extends Controller |
12
|
|
|
{ |
13
|
|
|
/* |
14
|
|
|
|-------------------------------------------------------------------------- |
15
|
|
|
| Email Verification Controller |
16
|
|
|
|-------------------------------------------------------------------------- |
17
|
|
|
| |
18
|
|
|
| This controller is responsible for handling email verification for any |
19
|
|
|
| user that recently registered with the application. Emails may also |
20
|
|
|
| be re-sent if the user didn't receive the original email message. |
21
|
|
|
| |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
use VerifiesEmails; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Where to redirect users after verification. |
28
|
|
|
* |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
protected $redirectTo = 'profile'; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Create a new controller instance. |
35
|
|
|
* |
36
|
|
|
* @return void |
37
|
|
|
*/ |
38
|
|
|
public function __construct() |
39
|
|
|
{ |
40
|
|
|
$this->middleware('auth'); |
41
|
|
|
$this->middleware('signed')->only('verify'); |
42
|
|
|
$this->middleware('throttle:6,1')->only('verify', 'resend'); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* The user has been verified. |
47
|
|
|
* |
48
|
|
|
* @param \Illuminate\Http\Request $request |
49
|
|
|
* @return mixed |
50
|
|
|
*/ |
51
|
|
|
protected function verified(Request $request) |
52
|
|
|
{ |
53
|
|
|
$callback = base64_decode($request->get('callback', '')); |
54
|
|
|
return view('public.auth.verified', ['callback' => $callback]); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Show the email verification notice. |
59
|
|
|
* @param \Illuminate\Http\Request $request |
60
|
|
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View |
61
|
|
|
*/ |
62
|
|
|
public function show(Request $request) |
63
|
|
|
{ |
64
|
|
|
return $request->user()->hasVerifiedEmail() |
65
|
|
|
? redirect($this->redirectPath()) |
66
|
|
|
: view('public.auth.verify'); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|